@@ -131,21 +131,21 @@ impl<'a> From<&'a VariantInfo<'a>> for Hash {
131131 let code = code. unwrap_or_else ( || {
132132 let msg = "Missing code attribute: e.g. #[mh(code = multihash::SHA3_256)]" ;
133133 #[ cfg( test) ]
134- panic ! ( msg) ;
134+ panic ! ( "{}" , msg) ;
135135 #[ cfg( not( test) ) ]
136136 proc_macro_error:: abort!( ident, msg) ;
137137 } ) ;
138138 let hasher = hasher. unwrap_or_else ( || {
139139 let msg = "Missing hasher attribute: e.g. #[mh(hasher = multihash::Sha2_256)]" ;
140140 #[ cfg( test) ]
141- panic ! ( msg) ;
141+ panic ! ( "{}" , msg) ;
142142 #[ cfg( not( test) ) ]
143143 proc_macro_error:: abort!( ident, msg) ;
144144 } ) ;
145145 let digest = digest. unwrap_or_else ( || {
146146 let msg = "Missing digest atttibute: e.g. #[mh(digest = multihash::Sha2Digest<U32>)]" ;
147147 #[ cfg( test) ]
148- panic ! ( msg) ;
148+ panic ! ( "{}" , msg) ;
149149 #[ cfg( not( test) ) ]
150150 proc_macro_error:: abort!( ident, msg) ;
151151 } ) ;
@@ -183,7 +183,7 @@ fn parse_code_enum_attrs(ast: &syn::DeriveInput) -> (syn::Type, bool) {
183183 None => {
184184 let msg = "enum is missing `alloc_size` attribute: e.g. #[mh(alloc_size = U64)]" ;
185185 #[ cfg( test) ]
186- panic ! ( msg) ;
186+ panic ! ( "{}" , msg) ;
187187 #[ cfg( not( test) ) ]
188188 proc_macro_error:: abort!( & ast. ident, msg) ;
189189 }
@@ -208,7 +208,7 @@ fn error_code_duplicates(hashes: &[Hash]) {
208208 // It's a duplicate
209209 if !uniq. insert ( code) {
210210 #[ cfg( test) ]
211- panic ! ( msg) ;
211+ panic ! ( "{}" , msg) ;
212212 #[ cfg( not( test) ) ]
213213 {
214214 let already_defined = uniq. get ( code) . unwrap ( ) ;
@@ -254,7 +254,7 @@ fn parse_alloc_size_attribute(alloc_size: &syn::Type) -> u64 {
254254 parse_unsigned_typenum ( & alloc_size) . unwrap_or_else ( |_| {
255255 let msg = "`alloc_size` attribute must be a `typenum`, e.g. #[mh(alloc_size = U64)]" ;
256256 #[ cfg( test) ]
257- panic ! ( msg) ;
257+ panic ! ( "{}" , msg) ;
258258 #[ cfg( not( test) ) ]
259259 proc_macro_error:: abort!( & alloc_size, msg) ;
260260 } )
@@ -278,7 +278,7 @@ fn error_alloc_size(hashes: &[Hash], expected_alloc_size_type: &syn::Type) {
278278 let msg = format ! ( "The `#mh(alloc_size) attribute must be bigger than the maximum defined digest size (U{})" ,
279279 max_digest_size) ;
280280 #[ cfg( test) ]
281- panic ! ( msg) ;
281+ panic ! ( "{}" , msg) ;
282282 #[ cfg( not( test) ) ]
283283 {
284284 let digest = & hash. digest . to_token_stream ( ) . to_string ( ) . replace ( " " , "" ) ;
@@ -305,7 +305,7 @@ fn error_alloc_size(hashes: &[Hash], expected_alloc_size_type: &syn::Type) {
305305 if let Err ( _error) = maybe_error {
306306 let msg = "Invalid byte size. It must be a unsigned integer typenum, e.g. `U32`" ;
307307 #[ cfg( test) ]
308- panic ! ( msg) ;
308+ panic ! ( "{}" , msg) ;
309309 #[ cfg( not( test) ) ]
310310 {
311311 proc_macro_error:: emit_error!( & _error. 0 , msg) ;
0 commit comments