Skip to content

Commit

Permalink
Update src/settings.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Tamo <[email protected]>
  • Loading branch information
NoodleSamaChan and irevoire authored Apr 21, 2024
1 parent ee20a31 commit 8f0c7cb
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,11 @@ impl Settings {

#[must_use]
pub fn with_distinct_attribute(self, distinct_attribute: Option<impl AsRef<str>>) -> Settings {
if let Some(distinct_attribute) = distinct_attribute {
Settings {
distinct_attribute: Some(Some(distinct_attribute.as_ref().to_string())),
..self
}
} else {
Settings {
distinct_attribute: Some(None),
..self
}
Settings {
distinct_attribute: Some(distinct_attribute.map(|distinct| distinct.to_string())),
..self
}

}
}

Expand Down

0 comments on commit 8f0c7cb

Please sign in to comment.