Skip to content

Commit 0464cb7

Browse files
committed
Update Clippy
1 parent 37e18b4 commit 0464cb7

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
runs-on: ubuntu-latest
3434
steps:
3535
- uses: actions/checkout@v4
36-
- uses: dtolnay/rust-toolchain@1.65
36+
- uses: dtolnay/rust-toolchain@stable
3737
with:
3838
components: clippy
3939
- run: cargo clippy --all-features --all-targets -- -D warnings

src/events.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,13 @@ impl Events {
209209
}
210210
}
211211

212+
impl Default for Events {
213+
#[inline]
214+
fn default() -> Self {
215+
Self::new()
216+
}
217+
}
218+
212219
impl ops::Deref for Events {
213220
type Target = [Event];
214221

src/lib.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@
130130
//! #[global_allocator]
131131
//! static ALLOCATOR: checkers::Allocator = checkers::Allocator::system();
132132
//!
133+
//! # /*
133134
//! #[test]
135+
//! # */
134136
//! fn test_event_inspection() {
135137
//! let snapshot = checkers::with(|| {
136138
//! let _ = vec![1, 2, 3, 4];
@@ -185,8 +187,8 @@ thread_local! {
185187
///
186188
/// Feel free to interact with this directly, but it's primarily used
187189
/// through the [`test`](crate::test) macro.
188-
static STATE: RefCell<State> = RefCell::new(State::new());
189-
static MUTED: Cell<bool> = Cell::new(true);
190+
static STATE: RefCell<State> = const { RefCell::new(State::new()) };
191+
static MUTED: Cell<bool> = const { Cell::new(true) };
190192
}
191193

192194
/// Perform an operation, while having access to the thread-local state.
@@ -430,6 +432,13 @@ impl State {
430432
}
431433
}
432434

435+
impl Default for State {
436+
#[inline]
437+
fn default() -> Self {
438+
Self::new()
439+
}
440+
}
441+
433442
/// A type-erased pointer.
434443
/// The inner representation is specifically _not_ a raw pointer to avoid
435444
/// aliasing the pointers handled by the allocator.

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub(crate) unsafe fn is_zeroed_ptr(ptr: *const u8, len: usize) -> bool {
1515
///
1616
/// `ptr` needs to be non-null and initialized to the length specified in `len`.
1717
#[cfg(feature = "realloc")]
18-
pub(crate) unsafe fn hash_ptr(ptr: *const u8, len: usize) -> impl PartialEq + Eq {
18+
pub(crate) unsafe fn hash_ptr(ptr: *const u8, len: usize) -> impl Eq {
1919
debug_assert!(!ptr.is_null());
2020
fxhash::hash64(std::slice::from_raw_parts(ptr, len))
2121
}

0 commit comments

Comments
 (0)