Skip to content

Commit 8f0c7cb

Browse files
Update src/settings.rs
Co-authored-by: Tamo <[email protected]>
1 parent ee20a31 commit 8f0c7cb

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/settings.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,11 @@ impl Settings {
218218

219219
#[must_use]
220220
pub fn with_distinct_attribute(self, distinct_attribute: Option<impl AsRef<str>>) -> Settings {
221-
if let Some(distinct_attribute) = distinct_attribute {
222-
Settings {
223-
distinct_attribute: Some(Some(distinct_attribute.as_ref().to_string())),
224-
..self
225-
}
226-
} else {
227-
Settings {
228-
distinct_attribute: Some(None),
229-
..self
230-
}
221+
Settings {
222+
distinct_attribute: Some(distinct_attribute.map(|distinct| distinct.to_string())),
223+
..self
224+
}
225+
231226
}
232227
}
233228

0 commit comments

Comments
 (0)