1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

refactor/polish ~ convert to try! to ? syntax

- convert to newer `?` syntax, fixing compiler warnings

+ requires MinSRV >= v1.13.0

.# [why]

The `?` operator was stabilized in rust v1.13.0.

Warnings requesting conversion from the old `try!` macro to the `?` operator
were introduced in rust v1.39.0.

* ref: <https://github.com/rust-lang/rust/blob/master/RELEASES.md>
This commit is contained in:
Roy Ivy III 2019-12-07 22:02:50 -06:00
parent c22cf215ba
commit b4b0ee40d7

View file

@ -163,7 +163,7 @@ pub fn log_info<T: AsRef<str>, U: AsRef<str>>(msg: T, par: U) {
pub fn recursive_copy(src: &Path, dest: &Path) -> Result<()> {
if fs::metadata(src)?.is_dir() {
for entry in try!(fs::read_dir(src)) {
for entry in fs::read_dir(src)? {
let entry = entry?;
let mut new_dest = PathBuf::from(dest);
new_dest.push(entry.file_name());