mirror of
git://git.proxmox.com/git/proxmox-backup.git
synced 2025-02-26 21:57:33 +03:00
remove redundant guards
Fixes the clippy lint: ``` warning: redundant guard --> pbs-datastore/src/chunk_store.rs:325:37 | 325 | Err(ref err) if err == &nix::errno::Errno::ENOENT => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_guards = note: `#[warn(clippy::redundant_guards)]` on by default help: try | 325 - Err(ref err) if err == &nix::errno::Errno::ENOENT => { 325 + Err(nix::errno::Errno::ENOENT) => { | ``` Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
parent
f1fabbe899
commit
5251bf89ba
@ -699,7 +699,7 @@ impl Extractor {
|
||||
if result.seeked_last {
|
||||
while match nix::unistd::ftruncate(file.as_raw_fd(), size as i64) {
|
||||
Ok(_) => false,
|
||||
Err(errno) if errno == nix::errno::Errno::EINTR => true,
|
||||
Err(nix::errno::Errno::EINTR) => true,
|
||||
Err(err) => return Err(err).context("error setting file size"),
|
||||
} {}
|
||||
}
|
||||
@ -758,7 +758,7 @@ impl Extractor {
|
||||
if result.seeked_last {
|
||||
while match nix::unistd::ftruncate(file.as_raw_fd(), size as i64) {
|
||||
Ok(_) => false,
|
||||
Err(errno) if errno == nix::errno::Errno::EINTR => true,
|
||||
Err(nix::errno::Errno::EINTR) => true,
|
||||
Err(err) => return Err(err).context("error setting file size"),
|
||||
} {}
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ impl ChunkStore {
|
||||
// start reading:
|
||||
continue;
|
||||
}
|
||||
Err(ref err) if err == &nix::errno::Errno::ENOENT => {
|
||||
Err(nix::errno::Errno::ENOENT) => {
|
||||
// non-existing directories are okay, just keep going:
|
||||
continue;
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ fn render_expire(value: &Value, _record: &Value) -> Result<String, Error> {
|
||||
return Ok(never);
|
||||
}
|
||||
let text = match value.as_i64() {
|
||||
Some(epoch) if epoch == 0 => never,
|
||||
Some(0) => never,
|
||||
Some(epoch) => {
|
||||
if let Ok(epoch_string) = proxmox_time::strftime_local("%c", epoch) {
|
||||
epoch_string
|
||||
|
Loading…
x
Reference in New Issue
Block a user