Skip to content

Commit

Permalink
Fix Clippy rules
Browse files Browse the repository at this point in the history
Main one is using const in thread_local!.
  • Loading branch information
Thomasdezeeuw committed Feb 4, 2024
1 parent edcd849 commit 89ae0a5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rt/src/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl Coordinator {
fn check_process_signals(&mut self, signal_received: &mut bool) -> Result<(), rt::Error> {
let timing = trace::start(&self.trace_log);
let waker = task::Waker::noop();
let mut ctx = task::Context::from_waker(&waker);
let mut ctx = task::Context::from_waker(waker);
loop {
match self.signals.poll_signal(&mut ctx) {
Poll::Ready(Some(Ok(info))) => {
Expand Down
6 changes: 3 additions & 3 deletions rt/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ where
Fut: Future + ?Sized,
{
let waker = task::Waker::noop();
let mut ctx = task::Context::from_waker(&waker);
let mut ctx = task::Context::from_waker(waker);
Future::poll(future, &mut ctx)
}

Expand All @@ -614,7 +614,7 @@ where
I: AsyncIterator + ?Sized,
{
let waker = task::Waker::noop();
let mut ctx = task::Context::from_waker(&waker);
let mut ctx = task::Context::from_waker(waker);
AsyncIterator::poll_next(iter, &mut ctx)
}

Expand All @@ -632,7 +632,7 @@ where
A: Actor + ?Sized,
{
let waker = task::Waker::noop();
let mut ctx = task::Context::from_waker(&waker);
let mut ctx = task::Context::from_waker(waker);
Actor::try_poll(actor, &mut ctx)
}

Expand Down
2 changes: 1 addition & 1 deletion rt/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ impl TraceLog for Log {
impl<'a> TraceLog for &'a SharedLog {
fn append(&mut self, substream_id: u64, event: &Event<'_>) -> io::Result<()> {
thread_local! {
static BUF: RefCell<Vec<u8>> = RefCell::new(Vec::new());
static BUF: RefCell<Vec<u8>> = const { RefCell::new(Vec::new()) };
}

BUF.with(|buf| {
Expand Down

0 comments on commit 89ae0a5

Please sign in to comment.