Skip to content
This repository was archived by the owner on Nov 29, 2025. It is now read-only.

Commit dd02cc3

Browse files
committed
fix: Rename {as_u64 => to_u64}
1 parent 33bc373 commit dd02cc3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sonyflake.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ pub(crate) const BIT_LEN_MACHINE_ID: u64 = 63 - BIT_LEN_TIME - BIT_LEN_SEQUENCE;
1818

1919
const GENERATE_MASK_SEQUENCE: u16 = (1 << BIT_LEN_SEQUENCE) - 1;
2020

21-
/// A generated Sonyflake ID.
21+
/// A generated Sonyflake id.
2222
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
2323
pub struct Id(u64);
2424

2525
impl Id {
2626
/// Returns the inner `u64` for this id.
2727
#[must_use]
28-
pub fn as_u64(self) -> u64 {
28+
pub fn to_u64(self) -> u64 {
2929
self.0
3030
}
3131
}
@@ -176,7 +176,7 @@ const MASK_MACHINE_ID: u64 = (1 << BIT_LEN_MACHINE_ID) - 1;
176176
/// Break a Sonyflake ID up into its parts.
177177
#[must_use]
178178
pub fn decompose(id: Id) -> DecomposedSonyflake {
179-
let id = id.as_u64();
179+
let id = id.to_u64();
180180
DecomposedSonyflake {
181181
id,
182182
msb: id >> 63,

0 commit comments

Comments
 (0)