Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "std-embedded-time"
authors = ["Ryan Summers <[email protected]"]
version = "0.1.0"
edition = "2018"
edition = "2024"
categories = ["embedded", "date-and-time", "development-tools"]
keywords = ["embedded", "date", "time", "test", "embedded-time"]
license-file = "LICENSE"
Expand All @@ -13,4 +13,4 @@ readme = "README.md"
documentation = "https://docs.rs/std-embedded-time"

[dependencies]
embedded-time = "0.12"
embedded-time = { git = "https://github.com/FluenTech/embedded-time.git", branch = "release/v0.13.0" }
13 changes: 6 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

pub use embedded_time;

use embedded_time::{fraction::Fraction, Instant};
use embedded_time::{Instant, fraction::Fraction};

/// A clock with nanosecond precision.
///
Expand Down Expand Up @@ -66,8 +66,7 @@ impl embedded_time::Clock for StandardClock {
#[cfg(test)]
mod test {
use super::StandardClock;
use core::convert::TryFrom;
use embedded_time::{duration::*, Clock};
use embedded_time::{Clock, duration::*};
use std::time::Duration;

#[test]
Expand All @@ -80,10 +79,10 @@ mod test {

let elapsed = end - start;

let lower_bound = Milliseconds::<u64>::try_from(999u32.milliseconds()).unwrap();
assert!(elapsed > lower_bound.into());
let lower_bound = Milliseconds(999u32);
assert!(elapsed > lower_bound);

let upper_bound = Milliseconds::<u64>::try_from(2000u32.milliseconds()).unwrap();
assert!(elapsed < upper_bound.into());
let upper_bound = 2000u32.milliseconds();
assert!(elapsed < upper_bound);
}
}