Skip to content

Commit 5d58eb9

Browse files
committed
asref
1 parent 7a342bf commit 5d58eb9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/concern.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ impl ReadConcern {
8181
/// Creates a read concern with a custom read concern level. This is present to provide forwards
8282
/// compatibility with any future read concerns which may be added to new versions of
8383
/// MongoDB.
84-
pub fn custom(level: &str) -> Self {
85-
ReadConcernLevel::from_str(level).into()
84+
pub fn custom(level: impl AsRef<str>) -> Self {
85+
ReadConcernLevel::from_str(level.as_ref()).into()
8686
}
8787

8888
#[cfg(test)]
@@ -306,8 +306,8 @@ impl WriteConcern {
306306
}
307307

308308
/// A `WriteConcern` with a custom acknowledgment.
309-
pub fn custom(s: &str) -> Self {
310-
Acknowledgment::from(s).into()
309+
pub fn custom(s: impl AsRef<str>) -> Self {
310+
Acknowledgment::from(s.as_ref()).into()
311311
}
312312

313313
pub(crate) fn is_acknowledged(&self) -> bool {

0 commit comments

Comments
 (0)