Skip to content

Commit

Permalink
fix(clippy): kill warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
saying121 committed Feb 22, 2025
1 parent c99ee59 commit 18e27ae
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/key_parse/src/key_parser.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::string_slice)]
#![allow(clippy::string_slice, reason = "todo: make it more grace")]

use crossterm::event::KeyCode;
use miette::bail;
Expand Down
2 changes: 1 addition & 1 deletion crates/lcode-config/src/config/user_serializes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ where
};
Ok(res)
}
#[expect(clippy::trivially_copy_pass_by_ref)]
#[expect(clippy::trivially_copy_pass_by_ref, reason = "follow signature")]
pub fn serialize<S>(v: &Suffix, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
Expand Down
2 changes: 1 addition & 1 deletion crates/lcode-config/src/theme/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::module_inception)]
#![allow(clippy::module_inception, reason = "that's ok")]
use self::theme::{Edit, Info, Select, Tab, TopicTags};

pub(crate) mod theme;
Expand Down
2 changes: 1 addition & 1 deletion crates/lcode/src/app/edit/cmds/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl ButState {
}

impl ButState {
#[expect(dead_code)]
#[expect(dead_code, reason = "util fn")]
pub fn open(&mut self) {
self.show = true;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/lcode/src/app/edit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl EditCode<'_> {
true
}

#[allow(non_snake_case)]
#[expect(non_snake_case, reason = "semantic")]
pub fn vertical_scroll_G(&mut self) -> bool {
if self.submit.show {
self.submit.last();
Expand Down
2 changes: 1 addition & 1 deletion crates/lcode/src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub enum TuiMode {
/// input panel
Insert,
/// input panel
#[expect(dead_code)]
#[expect(dead_code, reason = "todo use it")]
Visual,

/// not enter input
Expand Down
4 changes: 2 additions & 2 deletions crates/lcode/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ struct Cli {
command: Option<Commands>,
}

fn print_completions<G: Generator>(gen: G, cmd: &mut Command) {
generate(gen, cmd, cmd.get_name().to_owned(), &mut io::stdout());
fn print_completions<G: Generator>(genen: G, cmd: &mut Command) {
generate(genen, cmd, cmd.get_name().to_owned(), &mut io::stdout());
}

#[derive(Debug)]
Expand Down
2 changes: 1 addition & 1 deletion crates/leetcode-api/src/leetcode/impl_lc/judge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl LeetCode {
.expect("get_user_code regex new failed");

// sep code just get needed
#[expect(clippy::option_if_let_else)]
#[expect(clippy::option_if_let_else, reason = "borrow checker")]
let res = match code_re.captures(&code) {
Some(val) => val["code"].to_owned(),
None => code,
Expand Down

0 comments on commit 18e27ae

Please sign in to comment.