diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/textinput.rs | 2 | ||||
-rw-r--r-- | src/components/utils/filetree.rs | 6 | ||||
-rw-r--r-- | src/components/utils/statustree.rs | 5 | ||||
-rw-r--r-- | src/popups/blame_file.rs | 3 | ||||
-rw-r--r-- | src/ui/reflow.rs | 2 |
5 files changed, 7 insertions, 11 deletions
diff --git a/src/components/textinput.rs b/src/components/textinput.rs index a92519b3..0dff6e53 100644 --- a/src/components/textinput.rs +++ b/src/components/textinput.rs @@ -756,7 +756,7 @@ mod tests { if let Some(ta) = &mut comp.textarea { let txt = ta.lines(); assert_eq!(txt[0].len(), 1); - assert_eq!(txt[0].as_bytes()[0], 'a' as u8); + assert_eq!(txt[0].as_bytes()[0], b'a'); } } diff --git a/src/components/utils/filetree.rs b/src/components/utils/filetree.rs index 73ecfc74..8b298dbb 100644 --- a/src/components/utils/filetree.rs +++ b/src/components/utils/filetree.rs @@ -404,9 +404,9 @@ mod tests { ) .unwrap(); - assert_eq!(res.multiple_items_at_path(0), false); - assert_eq!(res.multiple_items_at_path(1), false); - assert_eq!(res.multiple_items_at_path(2), true); + assert!(!res.multiple_items_at_path(0)); + assert!(!res.multiple_items_at_path(1)); + assert!(res.multiple_items_at_path(2)); } #[test] diff --git a/src/components/utils/statustree.rs b/src/components/utils/statustree.rs index 4b3384d7..59c2b154 100644 --- a/src/components/utils/statustree.rs +++ b/src/components/utils/statustree.rs @@ -509,10 +509,7 @@ mod tests { false, // ] ); - assert_eq!( - res.is_visible_index(res.selection.unwrap()), - true - ); + assert!(res.is_visible_index(res.selection.unwrap())); assert_eq!(res.selection, Some(0)); } diff --git a/src/popups/blame_file.rs b/src/popups/blame_file.rs index af2fdb90..b3742475 100644 --- a/src/popups/blame_file.rs +++ b/src/popups/blame_file.rs @@ -197,8 +197,7 @@ impl Component for BlameFilePopup { let has_result = self .blame .as_ref() - .map(|blame| blame.result().is_some()) - .unwrap_or_default(); + .is_some_and(|blame| blame.result().is_some()); if self.is_visible() || force_all { out.push( CommandInfo::new( diff --git a/src/ui/reflow.rs b/src/ui/reflow.rs index 8b9c3cde..6255de4e 100644 --- a/src/ui/reflow.rs +++ b/src/ui/reflow.rs @@ -445,7 +445,7 @@ mod test { "mnopab cdefghi j", "klmno", ] - ) + ); } #[test] |