Skip to content

Commit

Permalink
chore: fix doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedtadde committed Aug 31, 2023
1 parent 9183a18 commit ae09c89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ description = "A consistent hashing library for Rust"
readme = "README.md"
homepage = "https://github.com/ahmedtadde/chash/"
repository = "https://github.com/ahmedtadde/chash/"
license = "MIT OR Apache-2.0"
license-file = "LICENSE.md"
keywords = ["consistent-hashing", "disttributed-systems", "hashing", "hash-ring", "hashring"]
include = [
Expand Down
15 changes: 10 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
///
/// This pkg is a port of ((and consistent with) the Go pkg https://github.com/buraksezer/consistent
///
/// # Example
/// # Examples
///
/// ```
/// use chash::HashRing;
/// use std::fmt::Formatter;
/// ```rust
/// use chash::{HashRingConfig, HashRing};
/// use std::{
/// collections::{hash_map::RandomState},
/// fmt::{Display, Formatter},
/// str::FromStr,
/// };
///
/// #[derive(Hash, PartialEq, Eq, Debug, Clone)]
/// struct HashRingNode {
Expand All @@ -25,12 +29,13 @@
/// type Err = ();
/// fn from_str(s: &str) -> Result<Self, Self::Err> {
/// Ok(Self::new(s.to_string()))
/// }
/// }
///
/// impl Display for HashRingNode {
/// fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
/// write!(f, "{}", self.uid)
/// }
/// }
/// }
///
/// let ring_config = HashRingConfig::new(23, 20, 1.25, RandomState::new());
Expand Down

0 comments on commit ae09c89

Please sign in to comment.