We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee20a31 commit 8f0c7cbCopy full SHA for 8f0c7cb
src/settings.rs
@@ -218,16 +218,11 @@ impl Settings {
218
219
#[must_use]
220
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
228
- distinct_attribute: Some(None),
229
230
+ Settings {
+ distinct_attribute: Some(distinct_attribute.map(|distinct| distinct.to_string())),
+ ..self
+ }
+
231
}
232
233
0 commit comments