Skip to content

Commit add75cc

Browse files
committed
Add rustfmt and fix pub mod platform conflict
1 parent ce9e635 commit add75cc

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

rustfmt.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
max_width = 160
2+
fn_params_layout = "Compressed"

src/gxhash/platform/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#[cfg(target_arch = "aarch64")]
22
#[path = "arm_128.rs"]
3-
pub mod platform;
3+
mod platform;
44

55
#[cfg(all(
66
feature = "avx2",
77
target_arch = "x86_64",
88
target_feature = "avx2")
99
)]
1010
#[path = "x86_256.rs"]
11-
pub mod platform;
11+
mod platform;
1212

1313
#[cfg(all(
1414
not(feature = "avx2"),
1515
target_arch = "x86_64"
1616
))]
1717
#[path = "x86_128.rs"]
18-
pub mod platform;
18+
mod platform;
1919

2020
use std::mem::size_of;
2121

src/hasher.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
use std::hash::{Hasher, BuildHasher};
21
use std::collections::{HashMap, HashSet};
2+
use std::hash::{BuildHasher, Hasher};
33
use std::mem::MaybeUninit;
44

55
use rand::RngCore;
66

7-
use crate::gxhash::*;
87
use crate::gxhash::platform::*;
8+
use crate::gxhash::*;
99

1010
/// A `Hasher` for hashing an arbitrary stream of bytes.
1111
/// # Features
1212
/// - The fastest [`Hasher`] of its class<sup>1</sup>, for all input sizes
1313
/// - Highly collision resitant
1414
/// - DOS resistance thanks to seed randomization when using [`GxHasher::default()`]
15-
///
15+
///
1616
/// *<sup>1</sup>There might me faster alternatives, such as `fxhash` for very small input sizes, but that usually have low quality properties.*
1717
pub struct GxHasher {
18-
state: State
18+
state: State,
1919
}
2020

2121
impl GxHasher {
@@ -27,11 +27,11 @@ impl GxHasher {
2727

2828
impl Default for GxHasher {
2929
/// Creates a new hasher with a empty seed.
30-
///
30+
///
3131
/// # Warning ⚠️
3232
/// Not using a seed may make your [`Hasher`] vulnerable to DOS attacks.
3333
/// It is recommended to use [`GxBuildHasher::default()`] for improved DOS resistance.
34-
///
34+
///
3535
/// # Example
3636
///
3737
/// ```
@@ -54,7 +54,7 @@ impl Default for GxHasher {
5454

5555
impl GxHasher {
5656
/// Creates a new hasher using the provided seed.
57-
///
57+
///
5858
/// # Warning ⚠️
5959
/// Hardcoding a seed may make your [`Hasher`] vulnerable to DOS attacks.
6060
/// It is recommended to use [`GxBuildHasher::default()`] for improved DOS resistance.
@@ -208,4 +208,4 @@ mod tests {
208208
hasher.write_i32(42);
209209
assert_eq!(hash, hasher.finish());
210210
}
211-
}
211+
}

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// Feature 'avx2' currently requires unstable 'stdsimd'
22
#![cfg_attr(all(feature = "avx2", target_arch = "x86_64"), feature(stdsimd))]
33

4+
#[rustfmt::skip]
45
mod gxhash;
56
mod hasher;
67

78
pub use gxhash::*;
8-
pub use hasher::*;
9+
pub use hasher::*;

0 commit comments

Comments
 (0)