Skip to content

Commit

Permalink
fix up tests in no_std
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Aug 7, 2024
1 parent 88c13c6 commit 7636357
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ mod tests {
assert_eq!(case, value.cast::<Kind>().unwrap());

let formatted = case.to_string();
let value = Value::from(&formatted);
let value = Value::from(&*formatted);

assert_eq!(case, value.cast::<Kind>().unwrap());
}
Expand Down
2 changes: 1 addition & 1 deletion src/level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ mod tests {
assert_eq!(case, value.cast::<Level>().unwrap());

let formatted = case.to_string();
let value = Value::from(&formatted);
let value = Value::from(&*formatted);

assert_eq!(case, value.cast::<Level>().unwrap());
}
Expand Down
7 changes: 6 additions & 1 deletion src/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,10 @@ impl<'a, C: Clock, P: Props, F: FnOnce(Span<'a, P>)> SpanGuard<'a, C, P, F> {
mod tests {
use super::*;

use std::{cell::Cell, time::Duration};
use std::time::Duration;

#[cfg(all(feature = "std", feature = "rand"))]
use std::cell::Cell;

use crate::Timestamp;

Expand Down Expand Up @@ -1528,8 +1531,10 @@ mod tests {
}
}

#[cfg(all(feature = "std", feature = "rand"))]
struct MyClock(Cell<u64>);

#[cfg(all(feature = "std", feature = "rand"))]
impl Clock for MyClock {
fn now(&self) -> Option<crate::Timestamp> {
let ts = crate::Timestamp::from_unix(Duration::from_secs(self.0.get()));
Expand Down

0 comments on commit 7636357

Please sign in to comment.