Skip to content

Commit c7564b9

Browse files
committed
clippy fixes
1 parent 33b69c5 commit c7564b9

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/de/raw.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,14 +1307,14 @@ impl<'de> serde::de::Deserializer<'de> for &mut RegexAccess<'de> {
13071307
self.stage = RegexDeserializationStage::Options;
13081308
match &self.re {
13091309
BsonCow::Borrowed(re) => visitor.visit_borrowed_str(re.pattern.as_str()),
1310-
BsonCow::Owned(re) => visitor.visit_str(&re.pattern.as_str()),
1310+
BsonCow::Owned(re) => visitor.visit_str(re.pattern.as_str()),
13111311
}
13121312
}
13131313
RegexDeserializationStage::Options => {
13141314
self.stage = RegexDeserializationStage::Done;
13151315
match &self.re {
13161316
BsonCow::Borrowed(re) => visitor.visit_borrowed_str(re.options.as_str()),
1317-
BsonCow::Owned(re) => visitor.visit_str(&re.options.as_str()),
1317+
BsonCow::Owned(re) => visitor.visit_str(re.options.as_str()),
13181318
}
13191319
}
13201320
RegexDeserializationStage::Done => {

src/raw/cstr.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,17 @@ impl CStr {
3939
self.as_str().len()
4040
}
4141

42+
pub fn is_empty(&self) -> bool {
43+
self.as_str().is_empty()
44+
}
45+
4246
pub(crate) fn append_to(&self, buf: &mut Vec<u8>) {
4347
buf.extend(&self.data);
4448
buf.push(0);
4549
}
4650
}
4751

48-
impl<'a, 'b> PartialEq<&'b CStr> for &'a CStr {
52+
impl PartialEq<&CStr> for &CStr {
4953
fn eq(&self, other: &&CStr) -> bool {
5054
self.as_str() == other.as_str()
5155
}

0 commit comments

Comments
 (0)