From 728797d0c148922885350924116d4fc83f2f9690 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 18 Jan 2019 16:50:15 +0100 Subject: [PATCH] reduce compiler warnings --- src/backup/archive_index.rs | 4 ++-- src/bin/proxmox-backup-client.rs | 10 +++++----- src/client/catar_backup_stream.rs | 2 +- src/config/datastore.rs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/backup/archive_index.rs b/src/backup/archive_index.rs index 2c7f5350..75da23ff 100644 --- a/src/backup/archive_index.rs +++ b/src/backup/archive_index.rs @@ -23,7 +23,7 @@ pub struct ArchiveIndexHeader { pub struct ArchiveIndexReader { store: Arc, - file: File, + _file: File, size: usize, filename: PathBuf, index: *const u8, @@ -95,7 +95,7 @@ impl ArchiveIndexReader { Ok(Self { store, filename: full_path, - file, + _file: file, size, index: data, index_entries: index_size/40, diff --git a/src/bin/proxmox-backup-client.rs b/src/bin/proxmox-backup-client.rs index c17a36dd..e8d98454 100644 --- a/src/bin/proxmox-backup-client.rs +++ b/src/bin/proxmox-backup-client.rs @@ -1,7 +1,7 @@ extern crate proxmox_backup; use failure::*; -use std::os::unix::io::AsRawFd; +//use std::os::unix::io::AsRawFd; use proxmox_backup::tools; use proxmox_backup::cli::command::*; @@ -13,7 +13,7 @@ use proxmox_backup::client::catar_backup_stream::*; //use proxmox_backup::backup::image_index::*; //use proxmox_backup::config::datastore; //use proxmox_backup::catar::encoder::*; -use proxmox_backup::backup::datastore::*; +//use proxmox_backup::backup::datastore::*; use serde_json::{Value}; use hyper::Body; @@ -71,13 +71,13 @@ fn create_backup(param: Value, _info: &ApiMethod) -> Result { let store = tools::required_string_param(¶m, "store")?; let target = tools::required_string_param(¶m, "target")?; - let mut chunk_size = 4*1024*1024; + let mut _chunk_size = 4*1024*1024; if let Some(size) = param["chunk-size"].as_u64() { static SIZES: [u64; 7] = [64, 128, 256, 512, 1024, 2048, 4096]; if SIZES.contains(&size) { - chunk_size = (size as usize) * 1024; + _chunk_size = (size as usize) * 1024; } else { bail!("Got unsupported chunk size '{}'", size); } @@ -101,7 +101,7 @@ fn create_backup(param: Value, _info: &ApiMethod) -> Result { println!("Backup image '{}' to '{}'", filename, store); if stat.st_size <= 0 { bail!("got strange file size '{}'", stat.st_size); } - let size = stat.st_size as usize; + let _size = stat.st_size as usize; panic!("implement me"); diff --git a/src/client/catar_backup_stream.rs b/src/client/catar_backup_stream.rs index 190f989f..de27f1d7 100644 --- a/src/client/catar_backup_stream.rs +++ b/src/client/catar_backup_stream.rs @@ -49,7 +49,7 @@ impl CaTarBackupStream { pub fn open(dirname: &str) -> Result { - let mut dir = nix::dir::Dir::open(dirname, OFlag::O_DIRECTORY, Mode::empty())?; + let dir = nix::dir::Dir::open(dirname, OFlag::O_DIRECTORY, Mode::empty())?; let path = std::path::PathBuf::from(dirname); Self::new(dir, path) diff --git a/src/config/datastore.rs b/src/config/datastore.rs index 14540ea2..2a916eec 100644 --- a/src/config/datastore.rs +++ b/src/config/datastore.rs @@ -78,7 +78,7 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> { } // shell completion helper -pub fn complete_datastore_name(arg: &str) -> Vec { +pub fn complete_datastore_name(_arg: &str) -> Vec { match config() { Ok(data) => data.sections.iter().map(|(id,_)| id.to_string()).collect(), Err(_) => return vec![],