Skip to content
Closed
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
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ const K: usize = 0x93d765dd;

impl FxHasher {
/// Creates a `fx` hasher with a given seed.
pub const fn with_seed(seed: usize) -> FxHasher {
FxHasher { hash: seed }
pub const fn with_seed(seed: usize) -> Self {
Self { hash: seed }
}

/// Creates a default `fx` hasher.
pub const fn default() -> FxHasher {
FxHasher { hash: 0 }
pub const fn default() -> Self {
Self { hash: 0 }
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/random_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub struct FxRandomState {

impl FxRandomState {
/// Constructs a new `FxRandomState` that is initialized with random seed.
pub fn new() -> FxRandomState {
pub fn new() -> Self {
use rand::Rng;
use std::{cell::Cell, thread_local};

Expand All @@ -38,7 +38,7 @@ impl FxRandomState {
SEED.with(|seed| {
let s = seed.get();
seed.set(s.wrapping_add(1));
FxRandomState { seed: s }
Self { seed: s }
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/seeded_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct FxSeededState {

impl FxSeededState {
/// Constructs a new `FxSeededState` that is initialized with a `seed`.
pub const fn with_seed(seed: usize) -> FxSeededState {
pub const fn with_seed(seed: usize) -> Self {
Self { seed }
}
}
Expand Down
Loading