1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Fix "panic message is not a string literal" warnings (#1915)

New in Rust 1.51.

Closes #1914
This commit is contained in:
Max Semenik 2021-03-26 13:09:16 +03:00 committed by GitHub
parent f431f58dd8
commit 035f811dd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -382,7 +382,7 @@ fn follow<T: Read>(readers: &mut [BufReader<T>], filenames: &[String], settings:
} }
print!("{}", datum); print!("{}", datum);
} }
Err(err) => panic!(err), Err(err) => panic!("{}", err),
} }
} }
} }
@ -509,7 +509,7 @@ fn unbounded_tail<T: Read>(reader: &mut BufReader<T>, settings: &Settings) {
ringbuf.push_back(datum); ringbuf.push_back(datum);
} }
} }
Err(err) => panic!(err), Err(err) => panic!("{}", err),
} }
} }
let mut stdout = stdout(); let mut stdout = stdout();
@ -540,7 +540,7 @@ fn unbounded_tail<T: Read>(reader: &mut BufReader<T>, settings: &Settings) {
ringbuf.push_back(datum[0]); ringbuf.push_back(datum[0]);
} }
} }
Err(err) => panic!(err), Err(err) => panic!("{}", err),
} }
} }
let mut stdout = stdout(); let mut stdout = stdout();

View file

@ -56,10 +56,10 @@ pub fn main(stream: proc_macro::TokenStream) -> proc_macro::TokenStream {
let mut expr = match expr { let mut expr = match expr {
syn::Expr::Lit(expr_lit) => match expr_lit.lit { syn::Expr::Lit(expr_lit) => match expr_lit.lit {
syn::Lit::Str(ref lit_str) => lit_str.parse::<syn::ExprPath>().unwrap(), syn::Lit::Str(ref lit_str) => lit_str.parse::<syn::ExprPath>().unwrap(),
_ => panic!(ARG_PANIC_TEXT), _ => panic!("{}", ARG_PANIC_TEXT),
}, },
syn::Expr::Path(expr_path) => expr_path, syn::Expr::Path(expr_path) => expr_path,
_ => panic!(ARG_PANIC_TEXT), _ => panic!("{}", ARG_PANIC_TEXT),
}; };
proc_dbg!(&expr); proc_dbg!(&expr);