diff --git a/src/format/mod.rs b/src/format/mod.rs index 93ffddf..0e91c16 100644 --- a/src/format/mod.rs +++ b/src/format/mod.rs @@ -73,8 +73,7 @@ impl Comment { fn comment_to_id(value: &str) -> String { value .to_lowercase() - .replace('/', "-") - .replace(' ', "-") + .replace(['/', ' '], "-") .replace("----", "-") .replace("---", "-") .replace("--", "-") diff --git a/src/main/mod.rs b/src/main/mod.rs index 0b9ae74..246e30f 100644 --- a/src/main/mod.rs +++ b/src/main/mod.rs @@ -21,7 +21,7 @@ fn get_content(options: &CliOptions) -> String { } Some(input_file) => { let mut s = String::new(); - let mut f = File::open(&input_file).expect("Unable to open file"); + let mut f = File::open(input_file).expect("Unable to open file"); f.read_to_string(&mut s).expect("Unable to read string"); s }