Skip to content

Commit 2fd341f

Browse files
minor: fix clippy (#235)
1 parent d6e269e commit 2fd341f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/extjson/de.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl TryFrom<serde_json::Map<String, serde_json::Value>> for Bson {
9494

9595
if obj.contains_key("$regularExpression") {
9696
let regex: models::Regex = serde_json::from_value(obj.into())?;
97-
return Ok(regex.parse()?.into());
97+
return Ok(regex.parse().into());
9898
}
9999

100100
if obj.contains_key("$numberInt") {
@@ -136,7 +136,7 @@ impl TryFrom<serde_json::Map<String, serde_json::Value>> for Bson {
136136

137137
if obj.contains_key("$timestamp") {
138138
let ts: models::Timestamp = serde_json::from_value(obj.into())?;
139-
return Ok(ts.parse()?.into());
139+
return Ok(ts.parse().into());
140140
}
141141

142142
if obj.contains_key("$date") {

src/extjson/models.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ struct RegexBody {
108108
}
109109

110110
impl Regex {
111-
pub(crate) fn parse(self) -> extjson::de::Result<crate::Regex> {
111+
pub(crate) fn parse(self) -> crate::Regex {
112112
let mut chars: Vec<_> = self.body.options.chars().collect();
113113
chars.sort_unstable();
114114
let options: String = chars.into_iter().collect();
115115

116-
Ok(crate::Regex {
116+
crate::Regex {
117117
pattern: self.body.pattern,
118118
options,
119-
})
119+
}
120120
}
121121
}
122122

@@ -214,11 +214,11 @@ pub(crate) struct TimestampBody {
214214
}
215215

216216
impl Timestamp {
217-
pub(crate) fn parse(self) -> extjson::de::Result<crate::Timestamp> {
218-
Ok(crate::Timestamp {
217+
pub(crate) fn parse(self) -> crate::Timestamp {
218+
crate::Timestamp {
219219
time: self.body.t,
220220
increment: self.body.i,
221-
})
221+
}
222222
}
223223
}
224224

0 commit comments

Comments
 (0)