@@ -20,12 +20,13 @@ mod base64;
2020mod error;
2121mod fields;
2222
23- pub use base64:: Base64 ;
2423pub use error:: { Error , Result } ;
2524pub use fields:: { Field , Fields } ;
2625
2726#[ cfg( feature = "alloc" ) ]
2827pub use allocating:: PasswordHash ;
28+ #[ cfg( feature = "base64" ) ]
29+ pub use base64:: Base64 ;
2930
3031/// Debug message used in panics when invariants aren't properly held.
3132const INVARIANT_MSG : & str = "should be ensured valid by constructor" ;
@@ -93,12 +94,13 @@ impl<'a> TryFrom<&'a str> for PasswordHashRef<'a> {
9394
9495#[ cfg( feature = "alloc" ) ]
9596mod allocating {
96- use crate :: {
97- Base64 , Error , Field , Fields , PasswordHashRef , Result , fields, validate, validate_id,
98- } ;
97+ use crate :: { Error , Field , Fields , PasswordHashRef , Result , fields, validate, validate_id} ;
9998 use alloc:: string:: String ;
10099 use core:: { fmt, str} ;
101100
101+ #[ cfg( feature = "base64" ) ]
102+ use crate :: Base64 ;
103+
102104 /// Password hash encoded in the Modular Crypt Format (MCF). Owned form with builder
103105 /// functionality.
104106 ///
@@ -166,6 +168,7 @@ mod allocating {
166168
167169 /// Encode the given data as the specified variant of Base64 and push it onto the password
168170 /// hash string, first adding a `$` delimiter.
171+ #[ cfg( feature = "base64" ) ]
169172 pub fn push_base64 ( & mut self , field : & [ u8 ] , base64_encoding : Base64 ) {
170173 self . 0 . push ( fields:: DELIMITER ) ;
171174 self . 0 . push_str ( & base64_encoding. encode_string ( field) ) ;
0 commit comments