Skip to content

Commit

Permalink
fix compile failure, clippy lints, check of cli in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
esheppa committed Jul 27, 2022
1 parent 74382b2 commit 889c04f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: cargo check --package ulid-cli
- run: cargo test
- run: cargo test --all-features
- run: cargo test --no-default-features --features=std
Expand Down
2 changes: 1 addition & 1 deletion benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::time::SystemTime;
use ulid::{Generator, Ulid, ULID_LEN};

fn bench_new(b: &mut Bencher) {
b.iter(|| Ulid::new());
b.iter(Ulid::new);
}

fn bench_generator_generate(b: &mut Bencher) {
Expand Down
1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ edition = "2018"
[dependencies]
structopt = "0.2"
ulid = { version = "*", path = ".." }
time = "0.3.11"
4 changes: 2 additions & 2 deletions cli/src/bin/ulid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn generate(count: u32, monotonic: bool) {

fn inspect(values: &[String]) {
for val in values {
let ulid = Ulid::from_string(&val);
let ulid = Ulid::from_string(val);
match ulid {
Ok(ulid) => {
let upper_hex = format!("{:X}", ulid.0);
Expand All @@ -81,7 +81,7 @@ COMPONENTS:
",
ulid.to_string(),
upper_hex,
ulid.datetime(),
time::OffsetDateTime::from(ulid.datetime()),
ulid.timestamp_ms(),
upper_hex.chars().skip(6).collect::<String>()
);
Expand Down
1 change: 1 addition & 0 deletions src/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ impl fmt::Display for MonotonicError {
#[cfg(test)]
mod tests {
use super::*;
use std::time::Duration;

#[test]
fn test_order_monotonic() {
Expand Down

0 comments on commit 889c04f

Please sign in to comment.