Skip to content

Commit

Permalink
Merge pull request #11 from kazk/fix-clippy
Browse files Browse the repository at this point in the history
Fix clippy
  • Loading branch information
kazk authored Apr 23, 2024
2 parents cb6028b + 857746b commit d5ae16f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ pub struct Id(pub [u8; RAW_LEN]);

impl Id {
/// Create an Id from a bytes slice.
///
/// # Errors
///
/// Will return `Err` if the length of `bytes` is invalid.
pub fn from_bytes(bytes: &[u8]) -> Result<Self, ParseIdError> {
if bytes.len() != RAW_LEN {
return Err(ParseIdError::InvalidLength(bytes.len()));
Expand Down Expand Up @@ -65,6 +69,7 @@ impl Id {
}

/// Returns true if this is a "zero" ID
#[must_use]
pub fn is_zero(&self) -> bool {
self.0 == ZERO.0
}
Expand Down
2 changes: 1 addition & 1 deletion src/machine_id.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rand::RngCore;
#[cfg(any(target_os = "macos"))]
#[cfg(target_os = "macos")]
use sysctl::{Sysctl, SysctlError};

// https://github.com/rs/xid/blob/efa678f304ab65d6d57eedcb086798381ae22206/id.go#L117
Expand Down

0 comments on commit d5ae16f

Please sign in to comment.