Skip to content

Commit 135e114

Browse files
committed
Convert allow to expect and remove unused expects
1 parent abab4b8 commit 135e114

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+141
-115
lines changed

src/arguments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ mod tests {
102102

103103
#[cfg(unix)]
104104
#[test]
105-
#[allow(unsafe_code)]
105+
#[expect(unsafe_code)]
106106
fn todo_file_invalid() {
107107
let args = unsafe { vec![OsString::from(String::from_utf8_unchecked(vec![0xC3, 0x28]))] };
108108
_ = Args::try_from(args).unwrap_err();

src/components.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ pub(crate) mod edit;
44
pub(crate) mod help;
55
pub(crate) mod search_bar;
66
mod shared;
7-
#[allow(dead_code)]
87
pub(crate) mod spin_indicator;

src/components/choice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub(crate) struct Choice<T> {
2323
impl<T> Choice<T>
2424
where T: Clone
2525
{
26-
#[allow(clippy::pattern_type_mismatch)]
26+
#[expect(clippy::pattern_type_mismatch, reason = "Legacy, needs refactor.")]
2727
pub(crate) fn new(options: Vec<(T, char, String)>) -> Self {
2828
let map = options
2929
.iter()
@@ -54,7 +54,7 @@ where T: Clone
5454
});
5555
}
5656

57-
#[allow(clippy::pattern_type_mismatch)]
57+
#[expect(clippy::pattern_type_mismatch, reason = "Legacy, needs refactor.")]
5858
pub(crate) fn get_view_data(&mut self) -> &ViewData {
5959
let options = &self.options;
6060
let invalid_selection = self.invalid_selection;

src/components/confirm.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ impl Confirm {
6161
event
6262
}
6363

64-
#[allow(clippy::unused_self)]
6564
pub(crate) const fn handle_event(&self, event: Event) -> Confirmed {
6665
if let Event::Standard(standard_event) = event {
6766
match standard_event {

src/components/edit.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ impl Edit {
8686
self.finished = false;
8787
}
8888

89-
#[allow(clippy::unused_self)]
9089
pub(crate) fn input_options(&self) -> &InputOptions {
9190
&INPUT_OPTIONS
9291
}

src/components/help.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub(crate) struct Help {
2222
}
2323

2424
impl Help {
25-
#[allow(clippy::pattern_type_mismatch)]
25+
#[expect(clippy::pattern_type_mismatch, reason = "Legacy, needs refactor.")]
2626
fn get_max_help_key_length(lines: &[(Vec<String>, String)]) -> usize {
2727
let mut max_length = 0;
2828
for (key, _) in lines {

src/components/spin_indicator.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ mod tests {
5454
assert_eq!(indicator.indicator(), "(\\)");
5555
}
5656

57-
const INDICATOR_CHARACTERS: [&str; 4] = ["-", "\\", "|", "/"];
5857
#[test]
5958
fn full_animation() {
6059
let mut indicator = SpinIndicator::new();

src/config/color.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use crate::config::InvalidColorError;
22

33
/// Represents a color.
44
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5-
#[allow(clippy::exhaustive_enums)]
65
pub(crate) enum Color {
76
/// The default terminal color.
87
Default,
@@ -58,7 +57,7 @@ pub(crate) enum Color {
5857
impl TryFrom<&str> for Color {
5958
type Error = InvalidColorError;
6059

61-
#[allow(clippy::unwrap_in_result)]
60+
#[expect(clippy::unwrap_in_result, reason = "Cast to u8 is safe.")]
6261
fn try_from(s: &str) -> Result<Self, Self::Error> {
6362
match s {
6463
"black" | "light black" => Ok(Self::LightBlack),

src/config/errors.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub(crate) use self::{config_error_cause::ConfigErrorCause, invalid_color::Inval
1515
/// Config errors
1616
#[derive(Error, Debug, PartialEq)]
1717
#[non_exhaustive]
18-
#[allow(clippy::module_name_repetitions)]
1918
pub(crate) struct ConfigError {
2019
name: String,
2120
input: Option<String>,

src/config/errors/config_error_cause.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use crate::{config::InvalidColorError, git::GitError};
55
/// The kind of config error that occurred.
66
#[derive(Error, Debug, PartialEq)]
77
#[non_exhaustive]
8-
#[allow(variant_size_differences)]
98
pub(crate) enum ConfigErrorCause {
109
/// The input provided is not a valid color
1110
#[error(transparent)]

0 commit comments

Comments
 (0)