mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-24 02:01:18 +07:00
Fix Clippy warnings
This commit is contained in:
@@ -14,7 +14,7 @@ fn extract_kdl_from_file(file_contents: &str, filename: &str) -> Vec<KdlCodeBloc
|
|||||||
.map(|line| {
|
.map(|line| {
|
||||||
// Removes the > from callouts that might contain ```kdl```
|
// Removes the > from callouts that might contain ```kdl```
|
||||||
let line = line.trim();
|
let line = line.trim();
|
||||||
if line.starts_with(">") {
|
if line.starts_with('>') {
|
||||||
if line.len() == 1 {
|
if line.len() == 1 {
|
||||||
""
|
""
|
||||||
} else {
|
} else {
|
||||||
@@ -58,7 +58,7 @@ fn extract_kdl_from_file(file_contents: &str, filename: &str) -> Vec<KdlCodeBloc
|
|||||||
fn wiki_docs_parses() {
|
fn wiki_docs_parses() {
|
||||||
let wiki_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../wiki");
|
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()
|
.unwrap()
|
||||||
.filter_map(|entry| entry.ok())
|
.filter_map(|entry| entry.ok())
|
||||||
.filter(|entry| entry.file_type().is_ok_and(|ft| ft.is_file()))
|
.filter(|entry| entry.file_type().is_ok_and(|ft| ft.is_file()))
|
||||||
@@ -68,13 +68,12 @@ fn wiki_docs_parses() {
|
|||||||
.map(|ext| ext == "md")
|
.map(|ext| ext == "md")
|
||||||
.unwrap_or(false)
|
.unwrap_or(false)
|
||||||
})
|
})
|
||||||
.map(|file| {
|
.flat_map(|file| {
|
||||||
let file_contents = fs::read_to_string(file.path()).unwrap();
|
let file_contents = fs::read_to_string(file.path()).unwrap();
|
||||||
let file_path = file.path();
|
let file_path = file.path();
|
||||||
let filename = file_path.to_str().unwrap();
|
let filename = file_path.to_str().unwrap();
|
||||||
extract_kdl_from_file(&file_contents, filename)
|
extract_kdl_from_file(&file_contents, filename)
|
||||||
})
|
});
|
||||||
.flatten();
|
|
||||||
|
|
||||||
let mut errors = vec![];
|
let mut errors = vec![];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user