reduce compiler warnings
This commit is contained in:
parent
383e857749
commit
728797d0c1
@ -23,7 +23,7 @@ pub struct ArchiveIndexHeader {
|
|||||||
|
|
||||||
pub struct ArchiveIndexReader {
|
pub struct ArchiveIndexReader {
|
||||||
store: Arc<ChunkStore>,
|
store: Arc<ChunkStore>,
|
||||||
file: File,
|
_file: File,
|
||||||
size: usize,
|
size: usize,
|
||||||
filename: PathBuf,
|
filename: PathBuf,
|
||||||
index: *const u8,
|
index: *const u8,
|
||||||
@ -95,7 +95,7 @@ impl ArchiveIndexReader {
|
|||||||
Ok(Self {
|
Ok(Self {
|
||||||
store,
|
store,
|
||||||
filename: full_path,
|
filename: full_path,
|
||||||
file,
|
_file: file,
|
||||||
size,
|
size,
|
||||||
index: data,
|
index: data,
|
||||||
index_entries: index_size/40,
|
index_entries: index_size/40,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
extern crate proxmox_backup;
|
extern crate proxmox_backup;
|
||||||
|
|
||||||
use failure::*;
|
use failure::*;
|
||||||
use std::os::unix::io::AsRawFd;
|
//use std::os::unix::io::AsRawFd;
|
||||||
|
|
||||||
use proxmox_backup::tools;
|
use proxmox_backup::tools;
|
||||||
use proxmox_backup::cli::command::*;
|
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::backup::image_index::*;
|
||||||
//use proxmox_backup::config::datastore;
|
//use proxmox_backup::config::datastore;
|
||||||
//use proxmox_backup::catar::encoder::*;
|
//use proxmox_backup::catar::encoder::*;
|
||||||
use proxmox_backup::backup::datastore::*;
|
//use proxmox_backup::backup::datastore::*;
|
||||||
|
|
||||||
use serde_json::{Value};
|
use serde_json::{Value};
|
||||||
use hyper::Body;
|
use hyper::Body;
|
||||||
@ -71,13 +71,13 @@ fn create_backup(param: Value, _info: &ApiMethod) -> Result<Value, Error> {
|
|||||||
let store = tools::required_string_param(¶m, "store")?;
|
let store = tools::required_string_param(¶m, "store")?;
|
||||||
let target = tools::required_string_param(¶m, "target")?;
|
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() {
|
if let Some(size) = param["chunk-size"].as_u64() {
|
||||||
static SIZES: [u64; 7] = [64, 128, 256, 512, 1024, 2048, 4096];
|
static SIZES: [u64; 7] = [64, 128, 256, 512, 1024, 2048, 4096];
|
||||||
|
|
||||||
if SIZES.contains(&size) {
|
if SIZES.contains(&size) {
|
||||||
chunk_size = (size as usize) * 1024;
|
_chunk_size = (size as usize) * 1024;
|
||||||
} else {
|
} else {
|
||||||
bail!("Got unsupported chunk size '{}'", size);
|
bail!("Got unsupported chunk size '{}'", size);
|
||||||
}
|
}
|
||||||
@ -101,7 +101,7 @@ fn create_backup(param: Value, _info: &ApiMethod) -> Result<Value, Error> {
|
|||||||
println!("Backup image '{}' to '{}'", filename, store);
|
println!("Backup image '{}' to '{}'", filename, store);
|
||||||
|
|
||||||
if stat.st_size <= 0 { bail!("got strange file size '{}'", stat.st_size); }
|
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");
|
panic!("implement me");
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ impl CaTarBackupStream {
|
|||||||
|
|
||||||
pub fn open(dirname: &str) -> Result<Self, Error> {
|
pub fn open(dirname: &str) -> Result<Self, Error> {
|
||||||
|
|
||||||
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);
|
let path = std::path::PathBuf::from(dirname);
|
||||||
|
|
||||||
Self::new(dir, path)
|
Self::new(dir, path)
|
||||||
|
@ -78,7 +78,7 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// shell completion helper
|
// shell completion helper
|
||||||
pub fn complete_datastore_name(arg: &str) -> Vec<String> {
|
pub fn complete_datastore_name(_arg: &str) -> Vec<String> {
|
||||||
match config() {
|
match config() {
|
||||||
Ok(data) => data.sections.iter().map(|(id,_)| id.to_string()).collect(),
|
Ok(data) => data.sections.iter().map(|(id,_)| id.to_string()).collect(),
|
||||||
Err(_) => return vec![],
|
Err(_) => return vec![],
|
||||||
|
Loading…
Reference in New Issue
Block a user