Skip to content

Commit d5ae16f

Browse files
authored
Merge pull request #11 from kazk/fix-clippy
Fix clippy
2 parents cb6028b + 857746b commit d5ae16f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/id.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ pub struct Id(pub [u8; RAW_LEN]);
1717

1818
impl Id {
1919
/// Create an Id from a bytes slice.
20+
///
21+
/// # Errors
22+
///
23+
/// Will return `Err` if the length of `bytes` is invalid.
2024
pub fn from_bytes(bytes: &[u8]) -> Result<Self, ParseIdError> {
2125
if bytes.len() != RAW_LEN {
2226
return Err(ParseIdError::InvalidLength(bytes.len()));
@@ -65,6 +69,7 @@ impl Id {
6569
}
6670

6771
/// Returns true if this is a "zero" ID
72+
#[must_use]
6873
pub fn is_zero(&self) -> bool {
6974
self.0 == ZERO.0
7075
}

src/machine_id.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rand::RngCore;
2-
#[cfg(any(target_os = "macos"))]
2+
#[cfg(target_os = "macos")]
33
use sysctl::{Sysctl, SysctlError};
44

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

0 commit comments

Comments
 (0)