diff options
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()?, )) |