Skip to content

Commit

Permalink
fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Nugine committed Dec 1, 2024
1 parent 4e5c63d commit 27f043f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/epkv-epaxos/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ macro_rules! impl_add_one {
#[inline]
#[must_use]
#[track_caller]
pub fn add_one(self) -> Self {
pub const fn add_one(self) -> Self {
Self(self.0.checked_add(1).expect(concat!(stringify!($ty), " overflow")))
}
}
Expand All @@ -91,7 +91,7 @@ macro_rules! impl_sub_one {
#[inline]
#[must_use]
#[track_caller]
pub fn sub_one(self) -> Self {
pub const fn sub_one(self) -> Self {
Self(self.0.checked_sub(1).expect(concat!(stringify!($ty), " underflow")))
}
}
Expand Down Expand Up @@ -226,7 +226,7 @@ mod tests {

#[test]
#[should_panic]
fn underflow() {
const fn underflow() {
let _ = LocalInstanceId::ZERO.sub_one();
}

Expand Down

0 comments on commit 27f043f

Please sign in to comment.