File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ pub enum Version {
5353#[ cfg( any( feature = "alloc" , feature = "std" ) ) ]
5454impl HashParts {
5555 /// Creates the bcrypt hash string from all its parts
56- fn format ( self ) -> String {
56+ fn format ( & self ) -> String {
5757 self . format_for_version ( Version :: TwoB )
5858 }
5959
@@ -84,9 +84,9 @@ impl FromStr for HashParts {
8484}
8585
8686#[ cfg( any( feature = "alloc" , feature = "std" ) ) ]
87- impl ToString for HashParts {
88- fn to_string ( & self ) -> String {
89- self . format_for_version ( Version :: TwoY )
87+ impl fmt :: Display for HashParts {
88+ fn fmt ( & self , f : & mut fmt :: Formatter ) -> fmt :: Result {
89+ write ! ( f , "{}" , self . format ( ) )
9090 }
9191}
9292
@@ -534,7 +534,7 @@ mod tests {
534534 . unwrap ( )
535535 . to_string ( ) ;
536536 assert_eq ! (
537- "$2y $05$HlFShUxTu4ZHHfOLJwfmCeDj/kuKFKboanXtDJXxCC7aIPTUgxNDe" ,
537+ "$2b $05$HlFShUxTu4ZHHfOLJwfmCeDj/kuKFKboanXtDJXxCC7aIPTUgxNDe" ,
538538 & hashed
539539 ) ;
540540 }
You can’t perform that action at this time.
0 commit comments