diff options
author | Joris | 2022-02-26 22:23:34 +0100 |
---|---|---|
committer | Joris | 2022-02-26 22:23:34 +0100 |
commit | 01a1e5e4f45dc80cd430d18492817b733fab5603 (patch) | |
tree | fa39d7abaf04d9b805a19767c088f7d61eecb509 /src/deck.rs | |
parent | 4ff3fa15967d989658804b94e1ce035dfd3e5a5c (diff) |
Fix linter warnings
Diffstat (limited to 'src/deck.rs')
-rw-r--r-- | src/deck.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/deck.rs b/src/deck.rs index e0f9fab..a414a02 100644 --- a/src/deck.rs +++ b/src/deck.rs @@ -32,14 +32,14 @@ pub fn read(deck: &str) -> Result<Vec<Entry>> { let line = line?; let line = line.trim(); - if !line.starts_with("#") && !line.is_empty() { - if !line.starts_with("-") { + if !line.starts_with('#') && !line.is_empty() { + if !line.starts_with('-') { return Err(Error::from(ParseError { line: index + 1, message: "an entry should starts with “-”.".to_string(), })); } else { - let translation = line[1..].trim().split(":").collect::<Vec<&str>>(); + let translation = line[1..].trim().split(':').collect::<Vec<&str>>(); if translation.len() != 2 { return Err(Error::from(ParseError { line: index + 1, @@ -68,7 +68,7 @@ pub fn read(deck: &str) -> Result<Vec<Entry>> { Ok(entries) } -pub fn pp_from_path(path: &String) -> Option<String> { +pub fn pp_from_path(path: &str) -> Option<String> { Some(capitalize( Path::new(&path).with_extension("").file_name()?.to_str()?, )) |