Skip to content

Commit e31ecd4

Browse files
minor: fix clippy (#216)
1 parent f6e1f5f commit e31ecd4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/bson.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ impl Bson {
339339
Bson::Null => Value::Null,
340340
Bson::RegularExpression(Regex { pattern, options }) => {
341341
let mut chars: Vec<_> = options.chars().collect();
342-
chars.sort();
342+
chars.sort_unstable();
343343

344344
let options: String = chars.into_iter().collect();
345345

@@ -492,7 +492,7 @@ impl Bson {
492492
ref options,
493493
}) => {
494494
let mut chars: Vec<_> = options.chars().collect();
495-
chars.sort();
495+
chars.sort_unstable();
496496

497497
let options: String = chars.into_iter().collect();
498498

@@ -602,7 +602,7 @@ impl Bson {
602602
}
603603

604604
let mut keys: Vec<_> = doc.keys().map(|s| s.as_str()).collect();
605-
keys.sort();
605+
keys.sort_unstable();
606606

607607
match keys.as_slice() {
608608
["$oid"] => {
@@ -712,7 +712,7 @@ impl Bson {
712712
if let Ok(pattern) = regex.get_str("pattern") {
713713
if let Ok(options) = regex.get_str("options") {
714714
let mut options: Vec<_> = options.chars().collect();
715-
options.sort();
715+
options.sort_unstable();
716716

717717
return Bson::RegularExpression(Regex {
718718
pattern: pattern.into(),

src/de/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ pub(crate) fn deserialize_bson_kvp<R: Read + ?Sized>(
262262
let pattern = read_cstring(reader)?;
263263

264264
let mut options: Vec<_> = read_cstring(reader)?.chars().collect();
265-
options.sort();
265+
options.sort_unstable();
266266

267267
Bson::RegularExpression(Regex {
268268
pattern,

src/extjson/models.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ struct RegexBody {
110110
impl Regex {
111111
pub(crate) fn parse(self) -> extjson::de::Result<crate::Regex> {
112112
let mut chars: Vec<_> = self.body.options.chars().collect();
113-
chars.sort();
113+
chars.sort_unstable();
114114
let options: String = chars.into_iter().collect();
115115

116116
Ok(crate::Regex {

0 commit comments

Comments
 (0)