]> git.proxmox.com Git - proxmox-backup.git/commitdiff
src/backup/chunk_store.rs: use ? insteadf of unwrap
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 10 Sep 2020 04:37:37 +0000 (06:37 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 10 Sep 2020 04:37:37 +0000 (06:37 +0200)
src/backup/chunk_store.rs

index 7f5c0693b48d06f0bd918e42ad7f10fbe25f7d55..df7d91423c6f449067b727837e7883be87a11785 100644 (file)
@@ -326,7 +326,7 @@ impl ChunkStore {
             if let Ok(stat) = fstatat(dirfd, filename, nix::fcntl::AtFlags::AT_SYMLINK_NOFOLLOW) {
                 if bad {
                     // filename validity checked in iterator
-                    let orig_filename = std::ffi::CString::new(&filename.to_bytes()[..64]).unwrap();
+                    let orig_filename = std::ffi::CString::new(&filename.to_bytes()[..64])?;
                     match fstatat(
                         dirfd,
                         orig_filename.as_c_str(),