clippy fixups for Default impls
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
e589e2b790
commit
c54aeedb8a
@ -928,6 +928,7 @@ impl MediaCatalog {
|
||||
/// Media set catalog
|
||||
///
|
||||
/// Catalog for multiple media.
|
||||
#[derive(Default)]
|
||||
pub struct MediaSetCatalog {
|
||||
catalog_list: HashMap<Uuid, MediaCatalog>,
|
||||
}
|
||||
@ -935,9 +936,7 @@ pub struct MediaSetCatalog {
|
||||
impl MediaSetCatalog {
|
||||
/// Creates a new instance
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
catalog_list: HashMap::new(),
|
||||
}
|
||||
Self::default()
|
||||
}
|
||||
|
||||
/// Add a catalog
|
||||
|
@ -15,6 +15,7 @@ pub struct MediaSet {
|
||||
impl MediaSet {
|
||||
pub const MEDIA_SET_MAX_SEQ_NR: u64 = 100;
|
||||
|
||||
#[allow(clippy::new_without_default)]
|
||||
pub fn new() -> Self {
|
||||
let uuid = Uuid::generate();
|
||||
Self {
|
||||
|
@ -7,6 +7,7 @@ use crate::tape::{MediaCatalog, MediaSetCatalog};
|
||||
/// Helper to build and query sets of catalogs
|
||||
///
|
||||
/// Similar to MediaSetCatalog, but allows to modify the last catalog.
|
||||
#[derive(Default)]
|
||||
pub struct CatalogSet {
|
||||
// read only part
|
||||
pub media_set_catalog: MediaSetCatalog,
|
||||
@ -17,10 +18,7 @@ pub struct CatalogSet {
|
||||
impl CatalogSet {
|
||||
/// Create empty instance
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
media_set_catalog: MediaSetCatalog::new(),
|
||||
catalog: None,
|
||||
}
|
||||
Self::default()
|
||||
}
|
||||
|
||||
/// Add catalog to the read-only set
|
||||
|
@ -769,7 +769,7 @@ pub struct DiskUsageQuery {
|
||||
}
|
||||
|
||||
impl DiskUsageQuery {
|
||||
pub fn new() -> Self {
|
||||
pub const fn new() -> Self {
|
||||
Self {
|
||||
smart: true,
|
||||
partitions: false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user