remove pbs-tools/src/cli.rs

Code is only used once in src/bin/proxmox_backup_debug/inspect.rs, so
move it into that file.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
Dietmar Maurer
2021-11-25 08:33:10 +01:00
parent 689ed51397
commit 0df179c2b4
3 changed files with 13 additions and 19 deletions

View File

@ -1,16 +0,0 @@
use std::fs::File;
use std::io::{self, stdout, Write};
use std::path::Path;
use std::panic::{RefUnwindSafe, UnwindSafe};
/// Returns either a new file, if a path is given, or stdout, if no path is given.
pub fn outfile_or_stdout<P: AsRef<Path>>(
path: Option<P>,
) -> io::Result<Box<dyn Write + Send + Sync + Unpin + RefUnwindSafe + UnwindSafe>> {
if let Some(path) = path {
let f = File::create(path)?;
Ok(Box::new(f) as Box<_>)
} else {
Ok(Box::new(stdout()) as Box<_>)
}
}

View File

@ -1,5 +1,4 @@
pub mod cert;
pub mod cli;
pub mod crypt_config;
pub mod format;
pub mod io;