diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-07-13 07:48:07 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-07-13 07:48:07 +0300 |
| commit | 8fdea033bc4ab9f2318153bac0738157b391aad3 (patch) | |
| tree | 52c91d97752c81a32ab6d5f7bd6702e8b4f26b0c | |
| parent | 2e906fc5fa9db0aa69cded149732d62b4b219aee (diff) | |
| download | niri-8fdea033bc4ab9f2318153bac0738157b391aad3.tar.gz niri-8fdea033bc4ab9f2318153bac0738157b391aad3.tar.bz2 niri-8fdea033bc4ab9f2318153bac0738157b391aad3.zip | |
Fix Clippy warnings
| -rw-r--r-- | niri-config/tests/wiki-parses.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/niri-config/tests/wiki-parses.rs b/niri-config/tests/wiki-parses.rs index ca7e9b75..5ea1f761 100644 --- a/niri-config/tests/wiki-parses.rs +++ b/niri-config/tests/wiki-parses.rs @@ -14,7 +14,7 @@ fn extract_kdl_from_file(file_contents: &str, filename: &str) -> Vec<KdlCodeBloc .map(|line| { // Removes the > from callouts that might contain ```kdl``` let line = line.trim(); - if line.starts_with(">") { + if line.starts_with('>') { if line.len() == 1 { "" } else { @@ -58,7 +58,7 @@ fn extract_kdl_from_file(file_contents: &str, filename: &str) -> Vec<KdlCodeBloc fn wiki_docs_parses() { let wiki_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../wiki"); - let code_blocks = fs::read_dir(&wiki_dir) + let code_blocks = fs::read_dir(wiki_dir) .unwrap() .filter_map(|entry| entry.ok()) .filter(|entry| entry.file_type().is_ok_and(|ft| ft.is_file())) @@ -68,13 +68,12 @@ fn wiki_docs_parses() { .map(|ext| ext == "md") .unwrap_or(false) }) - .map(|file| { + .flat_map(|file| { let file_contents = fs::read_to_string(file.path()).unwrap(); let file_path = file.path(); let filename = file_path.to_str().unwrap(); extract_kdl_from_file(&file_contents, filename) - }) - .flatten(); + }); let mut errors = vec![]; |
