Skip to content

Commit

Permalink
fix clippy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
zao111222333 committed Nov 16, 2024
1 parent 9751c8f commit 7380dc1
Show file tree
Hide file tree
Showing 10 changed files with 153 additions and 119 deletions.
1 change: 1 addition & 0 deletions macros/src/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cfg_if::cfg_if! {
{
use core::hash::{BuildHasher, Hash, Hasher};
const HASHER: foldhash::fast::FixedState = foldhash::fast::FixedState::with_seed(41);
#[allow(clippy::manual_hash_one)]
fn hash_one<T: Hash>(t: &T) -> u64 {
let mut hasher = HASHER.build_hasher();
t.hash(&mut hasher);
Expand Down
2 changes: 1 addition & 1 deletion src/ast/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl Indentation for DefaultIndentation {
}
}
/// `CodeFormatter` with indent
#[allow(missing_debug_implementations)]
#[expect(missing_debug_implementations)]
pub struct CodeFormatter<'a, F, I> {
f: &'a mut F,
level: usize,
Expand Down
3 changes: 2 additions & 1 deletion src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const DEFINED_COMMENT: &str = " /* user defined attribute */";
const HASHER: foldhash::fast::FixedState = foldhash::fast::FixedState::with_seed(41);
#[inline]
#[cfg(not(feature = "__dbg_no_hash_match"))]
#[expect(clippy::manual_hash_one)]
pub(crate) fn hash_one<T: Hash + ?Sized>(t: &T) -> u64 {
let mut hasher = HASHER.build_hasher();
t.hash(&mut hasher);
Expand Down Expand Up @@ -465,7 +466,7 @@ pub(crate) trait SimpleAttri: Sized + core::fmt::Display {

/// `ComplexParseError`
#[derive(thiserror::Error, Debug)]
pub enum ComplexParseError {
pub(crate) enum ComplexParseError {
/// `ParseFloatError`
#[error("{0}")]
Float(#[from] fast_float2::Error),
Expand Down
2 changes: 1 addition & 1 deletion src/common/demo.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(clippy::redundant_pub_crate)]
#![allow(clippy::redundant_pub_crate, clippy::doc_markdown)]
//! cargo expand common::demo
//! cargo expand common::demo --features __dbg_no_hash_match
use crate::{
Expand Down
5 changes: 4 additions & 1 deletion src/expression/boolean_expression/logic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ impl State {
#[must_use]
#[inline]
pub const fn bgn(&self) -> Static {
#[expect(clippy::match_same_arms)]
match self {
Self::L => Static::L,
Self::H => Static::H,
Expand All @@ -201,6 +202,7 @@ impl State {
#[must_use]
#[inline]
pub const fn end(&self) -> Static {
#[expect(clippy::match_same_arms)]
match self {
Self::L => Static::L,
Self::H => Static::H,
Expand Down Expand Up @@ -230,7 +232,8 @@ impl State {
/// | F/R | Any | Illegal |
#[must_use]
#[inline]
pub const fn combine_bgn_end(bgn: &Static, end: &Static) -> State {
pub const fn combine_bgn_end(bgn: Static, end: Static) -> Self {
#[expect(clippy::match_same_arms)]
match (bgn, end) {
(Static::X, Static::X) => Self::X,
(Static::X, Static::Z) => Self::X,
Expand Down
Loading

0 comments on commit 7380dc1

Please sign in to comment.