rename min_word_len_2_typo

This commit is contained in:
ad hoc 2022-03-31 13:51:27 +02:00
parent 55af85db3c
commit 286dd7b2e4
No known key found for this signature in database
GPG key ID: 4F00A782990CC643
3 changed files with 10 additions and 10 deletions

View file

@ -910,7 +910,7 @@ impl Index {
Ok(())
}
pub fn min_word_len_2_typo(&self, txn: &RoTxn) -> heed::Result<u8> {
pub fn min_word_len_2_typos(&self, txn: &RoTxn) -> heed::Result<u8> {
// It is not possible to put a bool in heed with OwnedType, so we put a u8 instead. We
// identify 0 as being false, and anything else as true. The absence of a value is true,
// because by default, we authorize typos.
@ -920,7 +920,7 @@ impl Index {
.unwrap_or(DEFAULT_MIN_WORD_LEN_2_TYPOS))
}
pub(crate) fn put_min_word_len_2_typo(&self, txn: &mut RwTxn, val: u8) -> heed::Result<()> {
pub(crate) fn put_min_word_len_2_typos(&self, txn: &mut RwTxn, val: u8) -> heed::Result<()> {
// It is not possible to put a bool in heed with OwnedType, so we put a u8 instead. We
// identify 0 as being false, and anything else as true. The absence of a value is true,
// because by default, we authorize typos.
@ -1072,15 +1072,15 @@ pub(crate) mod tests {
let mut txn = index.write_txn().unwrap();
assert_eq!(index.min_word_len_1_typo(&txn).unwrap(), DEFAULT_MIN_WORD_LEN_1_TYPO);
assert_eq!(index.min_word_len_2_typo(&txn).unwrap(), DEFAULT_MIN_WORD_LEN_2_TYPOS);
assert_eq!(index.min_word_len_2_typos(&txn).unwrap(), DEFAULT_MIN_WORD_LEN_2_TYPOS);
index.put_min_word_len_1_typo(&mut txn, 3).unwrap();
index.put_min_word_len_2_typo(&mut txn, 15).unwrap();
index.put_min_word_len_2_typos(&mut txn, 15).unwrap();
txn.commit().unwrap();
let txn = index.read_txn().unwrap();
assert_eq!(index.min_word_len_1_typo(&txn).unwrap(), 3);
assert_eq!(index.min_word_len_2_typo(&txn).unwrap(), 15);
assert_eq!(index.min_word_len_2_typos(&txn).unwrap(), 15);
}
}