From b582ea49df60067b323c568f064f2b5c8238d170 Mon Sep 17 00:00:00 2001 From: evenyag Date: Mon, 18 Sep 2023 21:08:36 +0800 Subject: [PATCH] style: fix clippy --- src/mito2/src/region/options.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/mito2/src/region/options.rs b/src/mito2/src/region/options.rs index 525bfe79d0ee..8e6f92b8934a 100644 --- a/src/mito2/src/region/options.rs +++ b/src/mito2/src/region/options.rs @@ -27,7 +27,7 @@ use crate::error::{Error, JsonOptionsSnafu, Result}; /// Options that affect the entire region. /// /// Users need to specify the options while creating/opening a region. -#[derive(Debug, Clone, PartialEq, Eq, Deserialize)] +#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize)] #[serde(default)] pub struct RegionOptions { /// Region SST files TTL. @@ -37,15 +37,6 @@ pub struct RegionOptions { pub compaction: CompactionOptions, } -impl Default for RegionOptions { - fn default() -> Self { - RegionOptions { - ttl: None, - compaction: CompactionOptions::default(), - } - } -} - impl TryFrom<&HashMap> for RegionOptions { type Error = Error; @@ -107,7 +98,7 @@ impl TwcsOptions { self.time_window.and_then(|window| { let window_secs = window.as_secs(); if window_secs == 0 { - return None; + None } else { window_secs.try_into().ok() }