clippy fixups for Default impls

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-07-28 10:30:02 +02:00
parent e589e2b790
commit c54aeedb8a
4 changed files with 6 additions and 8 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -769,7 +769,7 @@ pub struct DiskUsageQuery {
}
impl DiskUsageQuery {
pub fn new() -> Self {
pub const fn new() -> Self {
Self {
smart: true,
partitions: false,