From 01a1e5e4f45dc80cd430d18492817b733fab5603 Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 26 Feb 2022 22:23:34 +0100 Subject: Fix linter warnings --- src/deck.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/deck.rs') 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> { 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::>(); + let translation = line[1..].trim().split(':').collect::>(); if translation.len() != 2 { return Err(Error::from(ParseError { line: index + 1, @@ -68,7 +68,7 @@ pub fn read(deck: &str) -> Result> { Ok(entries) } -pub fn pp_from_path(path: &String) -> Option { +pub fn pp_from_path(path: &str) -> Option { Some(capitalize( Path::new(&path).with_extension("").file_name()?.to_str()?, )) -- cgit v1.2.3