avoid compiler warnings
This commit is contained in:
parent
36898ffce6
commit
1c0472e88f
@ -2,7 +2,7 @@ extern crate proxmox_backup;
|
|||||||
|
|
||||||
use failure::*;
|
use failure::*;
|
||||||
//use std::os::unix::io::AsRawFd;
|
//use std::os::unix::io::AsRawFd;
|
||||||
use chrono::{DateTime, Local, TimeZone};
|
use chrono::{Local, TimeZone};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ use proxmox_backup::backup::*;
|
|||||||
//use proxmox_backup::backup::datastore::*;
|
//use proxmox_backup::backup::datastore::*;
|
||||||
|
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
use hyper::Body;
|
//use hyper::Body;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use xdg::BaseDirectories;
|
use xdg::BaseDirectories;
|
||||||
@ -127,7 +127,7 @@ fn backup_directory<P: AsRef<Path>>(
|
|||||||
// spawn chunker inside a separate task so that it can run parallel
|
// spawn chunker inside a separate task so that it can run parallel
|
||||||
tokio::spawn(
|
tokio::spawn(
|
||||||
tx.send_all(chunk_stream.then(|r| Ok(r)))
|
tx.send_all(chunk_stream.then(|r| Ok(r)))
|
||||||
.map_err(|e| {}).map(|_| ())
|
.map_err(|_| {}).map(|_| ())
|
||||||
);
|
);
|
||||||
|
|
||||||
client.upload_stream(archive_name, stream, "dynamic", None).wait()?;
|
client.upload_stream(archive_name, stream, "dynamic", None).wait()?;
|
||||||
@ -141,7 +141,7 @@ fn backup_image<P: AsRef<Path>>(
|
|||||||
archive_name: &str,
|
archive_name: &str,
|
||||||
image_size: u64,
|
image_size: u64,
|
||||||
chunk_size: Option<usize>,
|
chunk_size: Option<usize>,
|
||||||
verbose: bool,
|
_verbose: bool,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
|
|
||||||
let path = image_path.as_ref().to_owned();
|
let path = image_path.as_ref().to_owned();
|
||||||
|
@ -880,7 +880,7 @@ fn detect_fs_type(fd: RawFd) -> Result<i64, Error> {
|
|||||||
use nix::{convert_ioctl_res, request_code_read, ioc};
|
use nix::{convert_ioctl_res, request_code_read, ioc};
|
||||||
|
|
||||||
// /usr/include/linux/fs.h: #define FS_IOC_GETFLAGS _IOR('f', 1, long)
|
// /usr/include/linux/fs.h: #define FS_IOC_GETFLAGS _IOR('f', 1, long)
|
||||||
/// read Linux file system attributes (see man chattr)
|
// read Linux file system attributes (see man chattr)
|
||||||
nix::ioctl_read!(read_attr_fd, b'f', 1, usize);
|
nix::ioctl_read!(read_attr_fd, b'f', 1, usize);
|
||||||
|
|
||||||
// /usr/include/linux/msdos_fs.h: #define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32)
|
// /usr/include/linux/msdos_fs.h: #define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32)
|
||||||
|
@ -211,7 +211,6 @@ pub fn file_set_contents_full<P: AsRef<Path>>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
use std::os::unix::io::FromRawFd;
|
|
||||||
let mut file = unsafe { File::from_raw_fd(fd) };
|
let mut file = unsafe { File::from_raw_fd(fd) };
|
||||||
|
|
||||||
if let Err(err) = file.write_all(data) {
|
if let Err(err) = file.write_all(data) {
|
||||||
@ -765,7 +764,6 @@ nix::ioctl_read!(blkgetsize64, 0x12, 114, u64);
|
|||||||
/// Return file or block device size
|
/// Return file or block device size
|
||||||
pub fn image_size(path: &Path) -> Result<u64, Error> {
|
pub fn image_size(path: &Path) -> Result<u64, Error> {
|
||||||
|
|
||||||
use std::os::unix::io::AsRawFd;
|
|
||||||
use std::os::unix::fs::FileTypeExt;
|
use std::os::unix::fs::FileTypeExt;
|
||||||
|
|
||||||
let file = std::fs::File::open(path)?;
|
let file = std::fs::File::open(path)?;
|
||||||
|
Loading…
Reference in New Issue
Block a user