Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
Signed-off-by: Runji Wang <[email protected]>
  • Loading branch information
wangrunji0408 committed Mar 22, 2024
1 parent 4a8b518 commit 52f6399
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions madsim-rdkafka/src/std/mocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ use crate::ClientContext;
///
/// In this case, we **must neither** destroy the mock cluster in `MockCluster`'s `drop()`,
/// **nor** outlive the `Client` from which the reference is obtained, hence the lifetime.
#[allow(dead_code)]
enum MockClusterClient<'c, C: ClientContext> {
Owned(Client<C>),
Borrowed(&'c Client<C>),
Expand Down
1 change: 1 addition & 0 deletions madsim-tokio/src/sim/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pub struct Runtime {
abort_handles: Mutex<Vec<AbortHandle>>,
}

#[allow(dead_code)]
pub struct EnterGuard<'a>(&'a Runtime);

impl Runtime {
Expand Down
2 changes: 1 addition & 1 deletion madsim/src/sim/rand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn init_std_random_state(seed: u64) -> bool {
}

thread_local! {
static SEED: Cell<Option<u64>> = Cell::new(None);
static SEED: Cell<Option<u64>> = const { Cell::new(None) };
}

/// Obtain a series of random bytes.
Expand Down
4 changes: 2 additions & 2 deletions madsim/src/sim/runtime/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::{
use std::{cell::RefCell, sync::Arc};

thread_local! {
static CONTEXT: RefCell<Option<Handle>> = RefCell::new(None);
static TASK: RefCell<Option<Arc<TaskInfo>>> = RefCell::new(None);
static CONTEXT: RefCell<Option<Handle>> = const { RefCell::new(None) };
static TASK: RefCell<Option<Arc<TaskInfo>>> = const { RefCell::new(None) };
}

pub(crate) fn current<T>(map: impl FnOnce(&Handle) -> T) -> T {
Expand Down

0 comments on commit 52f6399

Please sign in to comment.