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

Commit 58d28bb

Browse files
azasypkinkyeah
authored andcommitted
Migrate to the latest bson and bitflags crates. (#219)
1 parent c0e728d commit 58d28bb

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ license = "Apache-2.0"
77
name = "mongodb"
88
readme = "README.md"
99
repository = "https://github.com/mongodb-labs/mongo-rust-driver-prototype"
10-
version = "0.2.9"
10+
version = "0.3.0"
1111

1212
[dependencies]
13-
bitflags = "0.8.2"
14-
bson = "0.7.1"
13+
bitflags = "0.9.1"
14+
bson = "0.8.0"
1515
bufstream = "0.1.3"
1616
byteorder = "1.0.0"
1717
chrono = "0.3.1"
@@ -29,7 +29,7 @@ version = "~0"
2929

3030
[dependencies.openssl]
3131
optional = true
32-
version = "0.9.12"
32+
version = "0.9.13"
3333

3434
[dependencies.textnonce]
3535
default-features = false

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ The driver is available on crates.io. To use the MongoDB driver in your code, ad
2222

2323
```
2424
[dependencies]
25-
bson = "0.7.1"
26-
mongodb = "0.2.9"
25+
bson = "0.8.0"
26+
mongodb = "0.3.0"
2727
```
2828

2929
Alternately, you can use the MongoDB driver with SSL support. To do this, you must have OpenSSL installed on your system. Then, enable the `ssl` feature for MongoDB in your Cargo.toml:
3030

3131
```
3232
[dependencies]
3333
...
34-
mongodb = { version = "0.2.9", features = ["ssl"] }
34+
mongodb = { version = "0.3.0", features = ["ssl"] }
3535
```
3636

3737
Then, import the bson and driver libraries within your code.

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
))]
125125

126126
#[doc(html_root_url = "https://docs.rs/mongodb")]
127-
#[macro_use(bitflags)]
127+
#[macro_use]
128128
extern crate bitflags;
129129
#[macro_use(bson, doc)]
130130
extern crate bson;

src/wire_protocol/flags.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,38 @@ use coll::options::{CursorType, FindOptions};
33

44
bitflags! {
55
/// Represents the bit vector of options for an OP_REPLY message.
6-
pub flags OpReplyFlags: i32 {
7-
const CURSOR_NOT_FOUND = 0b00000001,
8-
const QUERY_FAILURE = 0b00000010,
9-
const AWAIT_CAPABLE = 0b00001000,
6+
pub struct OpReplyFlags: i32 {
7+
const CURSOR_NOT_FOUND = 0b00000001;
8+
const QUERY_FAILURE = 0b00000010;
9+
const AWAIT_CAPABLE = 0b00001000;
1010
}
1111
}
1212

1313
bitflags! {
1414
/// Represents the bit vector of options for an OP_UPDATE message.
15-
pub flags OpUpdateFlags: i32 {
16-
const UPSERT = 0b00000001,
17-
const MULTI_UPDATE = 0b00000010,
15+
pub struct OpUpdateFlags: i32 {
16+
const UPSERT = 0b00000001;
17+
const MULTI_UPDATE = 0b00000010;
1818
}
1919
}
2020

2121
bitflags! {
2222
/// Represents the bit vector of flags for an OP_INSERT message.
23-
pub flags OpInsertFlags: i32 {
24-
const CONTINUE_ON_ERROR = 0b00000001,
23+
pub struct OpInsertFlags: i32 {
24+
const CONTINUE_ON_ERROR = 0b00000001;
2525
}
2626
}
2727

2828
bitflags! {
2929
/// Represents the bit vector of flags for an OP_QUERY message.
30-
pub flags OpQueryFlags: i32 {
31-
const TAILABLE_CURSOR = 0b00000010,
32-
const SLAVE_OK = 0b00000100,
33-
const OPLOG_RELAY = 0b00001000,
34-
const NO_CURSOR_TIMEOUT = 0b00010000,
35-
const AWAIT_DATA = 0b00100000,
36-
const EXHAUST = 0b01000000,
37-
const PARTIAL = 0b10000000,
30+
pub struct OpQueryFlags: i32 {
31+
const TAILABLE_CURSOR = 0b00000010;
32+
const SLAVE_OK = 0b00000100;
33+
const OPLOG_RELAY = 0b00001000;
34+
const NO_CURSOR_TIMEOUT = 0b00010000;
35+
const AWAIT_DATA = 0b00100000;
36+
const EXHAUST = 0b01000000;
37+
const PARTIAL = 0b10000000;
3838
}
3939
}
4040

0 commit comments

Comments
 (0)