aboutsummaryrefslogtreecommitdiff
path: root/rust/libnewsboat
diff options
context:
space:
mode:
authorGravatar Dennis van der Schagt <dennisschagt@gmail.com> 2021-04-03 17:46:13 +0200
committerGravatar Dennis van der Schagt <dennisschagt@gmail.com> 2021-04-04 21:58:50 +0200
commit3f0aefb32c881214dba020eb99b98fed2fc45f89 (patch)
treea4682ca7da7084db02881b0b297e083dc3cec3be /rust/libnewsboat
parent2f7a110f7afe1cffdb0a114659f6d2e009e96a21 (diff)
downloadnewsboat-3f0aefb32c881214dba020eb99b98fed2fc45f89.tar.gz
newsboat-3f0aefb32c881214dba020eb99b98fed2fc45f89.tar.zst
newsboat-3f0aefb32c881214dba020eb99b98fed2fc45f89.zip
Compare directly with Some(String) instead of using is_some()+unwrap()
Diffstat (limited to 'rust/libnewsboat')
-rw-r--r--rust/libnewsboat/src/keymap.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/rust/libnewsboat/src/keymap.rs b/rust/libnewsboat/src/keymap.rs
index c10fe500..485b9495 100644
--- a/rust/libnewsboat/src/keymap.rs
+++ b/rust/libnewsboat/src/keymap.rs
@@ -380,8 +380,7 @@ mod tests {
let (operations, description) =
tokenize_operation_sequence(" \t set a b -- \"description\" \t ").unwrap();
assert_eq!(operations, vec![vec_of_strings!["set", "a", "b"]]);
- assert!(description.is_some());
- assert_eq!(description.unwrap(), "description");
+ assert_eq!(description, Some("description".to_string()));
}
#[test]
@@ -400,8 +399,7 @@ mod tests {
let (operations, description) =
tokenize_operation_sequence(r#"set a b -- "name of function""#).unwrap();
assert_eq!(operations, vec![vec_of_strings!["set", "a", "b"]]);
- assert!(description.is_some());
- assert_eq!(description.unwrap(), "name of function");
+ assert_eq!(description, Some("name of function".to_string()));
}
#[test]
@@ -424,8 +422,7 @@ mod tests {
fn verify_parsed_description(input: &str, expected_output: &str) {
let (_operations, description) = tokenize_operation_sequence(input).unwrap();
- assert!(description.is_some());
- assert_eq!(description.unwrap(), expected_output);
+ assert_eq!(description, Some(expected_output.to_string()));
}
#[test]