From 367f002ee2487ba4df8cdc129bc85f15bcd116f7 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 13 Aug 2019 12:59:03 +0200 Subject: [PATCH] use statement cleanup Signed-off-by: Wolfgang Bumiller --- src/backup/data_chunk.rs | 6 +++++- src/backup/datastore.rs | 26 +++++++++++++------------- src/backup/dynamic_index.rs | 25 +++++++++++-------------- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/src/backup/data_chunk.rs b/src/backup/data_chunk.rs index 773f7e73..700f914d 100644 --- a/src/backup/data_chunk.rs +++ b/src/backup/data_chunk.rs @@ -1,7 +1,11 @@ -use failure::*; use std::convert::TryInto; + +use failure::*; + use proxmox::tools::io::{ReadExt, WriteExt}; +// FIXME: Move all the magic numbers into a module so we can import super::magic::* instead of +// the everything of everything everywhere. use super::*; /// Data chunk with positional information diff --git a/src/backup/datastore.rs b/src/backup/datastore.rs index 47ed7600..61b3af03 100644 --- a/src/backup/datastore.rs +++ b/src/backup/datastore.rs @@ -1,23 +1,23 @@ -use failure::*; - -use std::io; -use std::path::{PathBuf, Path}; use std::collections::HashMap; +use std::io; +use std::path::{Path, PathBuf}; +use std::sync::{Arc, Mutex}; + +use failure::*; use lazy_static::lazy_static; -use std::sync::{Mutex, Arc}; -use crate::tools; -use crate::config::datastore; -use super::chunk_store::*; -use super::fixed_index::*; -use super::dynamic_index::*; +use super::backup_info::BackupDir; +use super::chunk_store::{ChunkStore, GarbageCollectionStatus}; +use super::dynamic_index::{DynamicIndexReader, DynamicIndexWriter}; +use super::fixed_index::{FixedIndexReader, FixedIndexWriter}; use super::index::*; -use super::backup_info::*; use super::DataChunk; +use crate::config::datastore; use crate::server::WorkerTask; +use crate::tools; -lazy_static!{ - static ref DATASTORE_MAP: Mutex>> = Mutex::new(HashMap::new()); +lazy_static! { + static ref DATASTORE_MAP: Mutex>> = Mutex::new(HashMap::new()); } /// Datastore Management diff --git a/src/backup/dynamic_index.rs b/src/backup/dynamic_index.rs index ce6269f4..2fa1c2c8 100644 --- a/src/backup/dynamic_index.rs +++ b/src/backup/dynamic_index.rs @@ -1,26 +1,23 @@ -use failure::*; use std::convert::TryInto; -use std::io::{Seek, SeekFrom}; - -use crate::tools; -use super::IndexFile; -use super::chunk_stat::*; -use super::chunk_store::*; -use super::read_chunk::*; -use proxmox_protocol::Chunker; - -use std::sync::Arc; -use std::io::{Write, BufWriter}; use std::fs::File; -use std::path::{Path, PathBuf}; +use std::io::{BufWriter, Seek, SeekFrom, Write}; use std::os::unix::io::AsRawFd; +use std::path::{Path, PathBuf}; +use std::sync::Arc; + +use failure::*; use uuid::Uuid; -//use chrono::{Local, TimeZone}; use proxmox::tools::io::ReadExt; use proxmox::tools::vec; +use proxmox_protocol::Chunker; +use super::chunk_stat::ChunkStat; +use super::chunk_store::ChunkStore; +use super::read_chunk::ReadChunk; +use super::IndexFile; use super::{DataChunk, DataChunkBuilder}; +use crate::tools; /// Header format definition for dynamic index files (`.dixd`) #[repr(C)]