@@ -131,21 +131,21 @@ impl<'a> From<&'a VariantInfo<'a>> for Hash {
131
131
let code = code. unwrap_or_else ( || {
132
132
let msg = "Missing code attribute: e.g. #[mh(code = multihash::SHA3_256)]" ;
133
133
#[ cfg( test) ]
134
- panic ! ( msg) ;
134
+ panic ! ( "{}" , msg) ;
135
135
#[ cfg( not( test) ) ]
136
136
proc_macro_error:: abort!( ident, msg) ;
137
137
} ) ;
138
138
let hasher = hasher. unwrap_or_else ( || {
139
139
let msg = "Missing hasher attribute: e.g. #[mh(hasher = multihash::Sha2_256)]" ;
140
140
#[ cfg( test) ]
141
- panic ! ( msg) ;
141
+ panic ! ( "{}" , msg) ;
142
142
#[ cfg( not( test) ) ]
143
143
proc_macro_error:: abort!( ident, msg) ;
144
144
} ) ;
145
145
let digest = digest. unwrap_or_else ( || {
146
146
let msg = "Missing digest atttibute: e.g. #[mh(digest = multihash::Sha2Digest<U32>)]" ;
147
147
#[ cfg( test) ]
148
- panic ! ( msg) ;
148
+ panic ! ( "{}" , msg) ;
149
149
#[ cfg( not( test) ) ]
150
150
proc_macro_error:: abort!( ident, msg) ;
151
151
} ) ;
@@ -183,7 +183,7 @@ fn parse_code_enum_attrs(ast: &syn::DeriveInput) -> (syn::Type, bool) {
183
183
None => {
184
184
let msg = "enum is missing `alloc_size` attribute: e.g. #[mh(alloc_size = U64)]" ;
185
185
#[ cfg( test) ]
186
- panic ! ( msg) ;
186
+ panic ! ( "{}" , msg) ;
187
187
#[ cfg( not( test) ) ]
188
188
proc_macro_error:: abort!( & ast. ident, msg) ;
189
189
}
@@ -208,7 +208,7 @@ fn error_code_duplicates(hashes: &[Hash]) {
208
208
// It's a duplicate
209
209
if !uniq. insert ( code) {
210
210
#[ cfg( test) ]
211
- panic ! ( msg) ;
211
+ panic ! ( "{}" , msg) ;
212
212
#[ cfg( not( test) ) ]
213
213
{
214
214
let already_defined = uniq. get ( code) . unwrap ( ) ;
@@ -254,7 +254,7 @@ fn parse_alloc_size_attribute(alloc_size: &syn::Type) -> u64 {
254
254
parse_unsigned_typenum ( & alloc_size) . unwrap_or_else ( |_| {
255
255
let msg = "`alloc_size` attribute must be a `typenum`, e.g. #[mh(alloc_size = U64)]" ;
256
256
#[ cfg( test) ]
257
- panic ! ( msg) ;
257
+ panic ! ( "{}" , msg) ;
258
258
#[ cfg( not( test) ) ]
259
259
proc_macro_error:: abort!( & alloc_size, msg) ;
260
260
} )
@@ -278,7 +278,7 @@ fn error_alloc_size(hashes: &[Hash], expected_alloc_size_type: &syn::Type) {
278
278
let msg = format ! ( "The `#mh(alloc_size) attribute must be bigger than the maximum defined digest size (U{})" ,
279
279
max_digest_size) ;
280
280
#[ cfg( test) ]
281
- panic ! ( msg) ;
281
+ panic ! ( "{}" , msg) ;
282
282
#[ cfg( not( test) ) ]
283
283
{
284
284
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) {
305
305
if let Err ( _error) = maybe_error {
306
306
let msg = "Invalid byte size. It must be a unsigned integer typenum, e.g. `U32`" ;
307
307
#[ cfg( test) ]
308
- panic ! ( msg) ;
308
+ panic ! ( "{}" , msg) ;
309
309
#[ cfg( not( test) ) ]
310
310
{
311
311
proc_macro_error:: emit_error!( & _error. 0 , msg) ;
0 commit comments