Skip to content
This repository was archived by the owner on Oct 18, 2021. It is now read-only.

Commit 152fc9b

Browse files
committed
fix bug for 3.2
1 parent 01fe6c6 commit 152fc9b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cursor.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ impl Cursor {
121121
if let Some(&Bson::I32(ref code)) = docs[0].get("code") {
122122
// If command doesn't exist or namespace not found, return
123123
// an empty array instead of throwing an error.
124-
if *code == ErrorCode::CommandNotFound as i32 ||
125-
*code == ErrorCode::NamespaceNotFound as i32 {
126-
return Ok((docs[0].clone(), v, cid));
127-
} else if let Some(&Bson::String(ref msg)) = docs[0].get("errmsg") {
124+
if *code != ErrorCode::CommandNotFound as i32 &&
125+
*code != ErrorCode::NamespaceNotFound as i32 {
126+
if let Some(&Bson::String(ref msg)) = docs[0].get("errmsg") {
128127
return Err(Error::OperationError(msg.to_owned()));
129128
}
129+
}
130130
}
131131
}
132132

0 commit comments

Comments
 (0)