mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 08:11:15 -03:00
refactor: misc cleanup (#10998)
* refactor EnvVar: Arc<Box<[WString]>> -> Arc<[WString]> * remove unnecessary `&mut` from EnvVar methods * clippy: use eq_ignore_ascii_case instead of manual comparison see https://rust-lang.github.io/rust-clippy/master/index.html#manual_ignore_case_cmp * clippy: use `is_some_and` and `is_ok_and` instead of `map_or` see https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or * clippy: use `assert!()` instead of `assert_eq!()` with booleans
This commit is contained in:
@@ -84,7 +84,7 @@ fn smoke() {
|
||||
#[test]
|
||||
fn test_format_string_str() {
|
||||
let mut s: &str = "hello%world%%%%%";
|
||||
assert_eq!(s.is_empty(), false);
|
||||
assert!(!s.is_empty());
|
||||
for (idx, c) in s.char_indices() {
|
||||
assert_eq!(s.at(idx), Some(c));
|
||||
}
|
||||
@@ -98,7 +98,7 @@ fn test_format_string_str() {
|
||||
assert_eq!(s.take_literal(&mut buffer), "world%%");
|
||||
|
||||
s.advance_by(1); // advancing over one more %
|
||||
assert_eq!(s.is_empty(), true); // remaining content is empty
|
||||
assert!(s.is_empty()); // remaining content is empty
|
||||
}
|
||||
|
||||
#[cfg(feature = "widestring")]
|
||||
@@ -122,7 +122,7 @@ fn test_format_string_wstr() {
|
||||
assert_eq!(s.take_literal(&mut buffer), "world%%");
|
||||
|
||||
s.advance_by(1); // advancing over one more %
|
||||
assert_eq!(s.is_empty(), true); // remaining content is empty
|
||||
assert!(s.is_empty()); // remaining content is empty
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user