Skip to content

Commit 5a19d2b

Browse files
authored
Merge pull request #681 from chewing/push-vsnpowyvukzq
refactor: fix clippy warning
2 parents 8e7ffd8 + bf54f58 commit 5a19d2b

4 files changed

Lines changed: 4 additions & 5 deletions

File tree

capi/src/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ pub unsafe extern "C" fn chewing_new2(
163163

164164
let estimate = LaxUserFreqEstimate::max_from(user_dictionary.as_ref());
165165

166-
let system_dicts = Vec::from_iter(dictionaries.into_iter().chain(drop_in_dicts.into_iter()));
166+
let system_dicts = Vec::from_iter(dictionaries.into_iter().chain(drop_in_dicts));
167167
let dict = Layered::new(system_dicts, user_dictionary);
168168
let conversion_engine = Box::new(ChewingEngine::new());
169169
let kb_compat = KeyboardLayoutCompat::Default;

src/editor/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl Editor {
194194
let sys_loader = SystemDictionaryLoader::new();
195195
let base_dict = sys_loader.load()?;
196196
let drop_in_dict = sys_loader.load_drop_in()?;
197-
let system_dict = Vec::from_iter(base_dict.into_iter().chain(drop_in_dict.into_iter()));
197+
let system_dict = Vec::from_iter(base_dict.into_iter().chain(drop_in_dict));
198198
let user_dict = UserDictionaryLoader::new().load()?;
199199
let estimate = LaxUserFreqEstimate::max_from(user_dict.as_ref());
200200
let dict = Layered::new(system_dict, user_dict);

src/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ fn project_data_dir() -> Option<PathBuf> {
148148
if let Ok(path) = env::var("XDG_DATA_HOME") {
149149
return Some(PathBuf::from(path).join("chewing"));
150150
}
151-
return env::home_dir().map(|path| path.join(".local").join("share").join("chewing"));
151+
env::home_dir().map(|path| path.join(".local").join("share").join("chewing"))
152152
}
153153
}
154154

tools/src/init_database.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ fn parse_line(
125125
) -> Result<(Vec<Syllable>, &str, u32)> {
126126
let phrase = line
127127
.split(delimiter)
128-
.filter(|s| !s.is_empty())
129-
.next()
128+
.find(|s| !s.is_empty())
130129
.ok_or(parse_error(line_num, line))?
131130
.trim_matches('"');
132131

0 commit comments

Comments
 (0)