Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit76dd6ac

Browse files
llamingtonsunli829
authored andcommitted
replace ok_or with ok_or_else
1 parent6589589 commit76dd6ac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/types/external/bson.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ impl ScalarType for ObjectId {
1414
Value::Object(o) =>{
1515
let json =Value::Object(o).into_json()?;
1616
let bson =Bson::try_from(json)?;
17-
bson.as_object_id().ok_or(InputValueError::custom(
18-
"could not parse the value as a BSON ObjectId",
19-
))
17+
bson.as_object_id().ok_or_else(||{
18+
InputValueError::custom("could not parse the value as a BSON ObjectId")
19+
})
2020
}
2121
_ =>Err(InputValueError::expected_type(value)),
2222
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp