Skip to content
Merged
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
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub enum Version {
#[cfg(any(feature = "alloc", feature = "std"))]
impl HashParts {
/// Creates the bcrypt hash string from all its parts
fn format(self) -> String {
fn format(&self) -> String {
self.format_for_version(Version::TwoB)
}

Expand Down Expand Up @@ -84,9 +84,9 @@ impl FromStr for HashParts {
}

#[cfg(any(feature = "alloc", feature = "std"))]
impl ToString for HashParts {
fn to_string(&self) -> String {
self.format_for_version(Version::TwoY)
impl fmt::Display for HashParts {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.format())
}
}

Expand Down Expand Up @@ -534,7 +534,7 @@ mod tests {
.unwrap()
.to_string();
assert_eq!(
"$2y$05$HlFShUxTu4ZHHfOLJwfmCeDj/kuKFKboanXtDJXxCC7aIPTUgxNDe",
"$2b$05$HlFShUxTu4ZHHfOLJwfmCeDj/kuKFKboanXtDJXxCC7aIPTUgxNDe",
&hashed
);
}
Expand Down