Skip to content

Commit 9f538a3

Browse files
fix(deps): update rust crate bson to v3 (#2012)
* fix(deps): update rust crate bson to v3 * fix: bson v3 enables serde --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: zonyitoo <[email protected]>
1 parent de97c75 commit 9f538a3

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

Cargo.lock

Lines changed: 12 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/shadowsocks-service/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ smoltcp = { version = "0.12", optional = true, default-features = false, feature
193193

194194
serde = { version = "1.0", features = ["derive"] }
195195
json5 = "0.4"
196-
bson = { version = "2.13.0", optional = true }
196+
bson = { version = "3.0.0", features = ["serde"], optional = true }
197197

198198
shadowsocks = { version = "1.23.2", path = "../shadowsocks", default-features = false }
199199

crates/shadowsocks-service/src/local/fake_dns/proto.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ pub struct StorageMeta {
1313

1414
impl StorageMeta {
1515
pub fn decode(v: &[u8]) -> io::Result<Self> {
16-
bson::from_slice(v).map_err(io::Error::other)
16+
bson::deserialize_from_slice(v).map_err(io::Error::other)
1717
}
1818

1919
pub fn encode_to_vec(&self) -> io::Result<Vec<u8>> {
20-
bson::to_vec(self).map_err(io::Error::other)
20+
bson::serialize_to_vec(self).map_err(io::Error::other)
2121
}
2222
}
2323

@@ -29,11 +29,11 @@ pub struct IpAddrMapping {
2929

3030
impl IpAddrMapping {
3131
pub fn decode(v: &[u8]) -> io::Result<Self> {
32-
bson::from_slice(v).map_err(io::Error::other)
32+
bson::deserialize_from_slice(v).map_err(io::Error::other)
3333
}
3434

3535
pub fn encode_to_vec(&self) -> io::Result<Vec<u8>> {
36-
bson::to_vec(self).map_err(io::Error::other)
36+
bson::serialize_to_vec(self).map_err(io::Error::other)
3737
}
3838
}
3939

@@ -46,10 +46,10 @@ pub struct DomainNameMapping {
4646

4747
impl DomainNameMapping {
4848
pub fn decode(v: &[u8]) -> io::Result<Self> {
49-
bson::from_slice(v).map_err(io::Error::other)
49+
bson::deserialize_from_slice(v).map_err(io::Error::other)
5050
}
5151

5252
pub fn encode_to_vec(&self) -> io::Result<Vec<u8>> {
53-
bson::to_vec(self).map_err(io::Error::other)
53+
bson::serialize_to_vec(self).map_err(io::Error::other)
5454
}
5555
}

0 commit comments

Comments
 (0)