From 906f2026115d97fafab44e072f9b2577e8dfec18 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 31 Aug 2021 14:19:36 +0200 Subject: [PATCH] Fix some more clippy suggestions --- instant-segment/src/test_data.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instant-segment/src/test_data.rs b/instant-segment/src/test_data.rs index 08e88d7..36fd5dd 100644 --- a/instant-segment/src/test_data.rs +++ b/instant-segment/src/test_data.rs @@ -26,7 +26,7 @@ pub fn segmenter(dir: PathBuf) -> Segmenter { .unwrap_or_else(|| panic!("no tab found in {:?}:{}", uni_file, i)); let word = ln[..split].into(); - let p = usize::from_str(&ln[split + 1..].trim()) + let p = usize::from_str(ln[split + 1..].trim()) .unwrap_or_else(|e| panic!("error at {:?}:{}: {}", uni_file, i, e)); unigrams.insert(word, p as f64); ln.clear(); @@ -49,7 +49,7 @@ pub fn segmenter(dir: PathBuf) -> Segmenter { let word1 = ln[..word_split].into(); let word2 = ln[word_split + 1..score_split].into(); - let p = usize::from_str(&ln[score_split + 1..].trim()) + let p = usize::from_str(ln[score_split + 1..].trim()) .unwrap_or_else(|e| panic!("error at {:?}:{}: {}", bi_file, i, e)); bigrams.insert((word1, word2), p as f64);