diff --git a/Cargo.lock b/Cargo.lock index ff796417d..e80004f12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -384,11 +384,12 @@ dependencies = [ [[package]] name = "bincode" -version = "1.3.3" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" dependencies = [ "serde", + "unty", ] [[package]] @@ -3584,6 +3585,12 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +[[package]] +name = "unty" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" + [[package]] name = "url" version = "2.5.4" diff --git a/openstack_sdk/Cargo.toml b/openstack_sdk/Cargo.toml index 26859a64f..979c931d2 100644 --- a/openstack_sdk/Cargo.toml +++ b/openstack_sdk/Cargo.toml @@ -43,7 +43,7 @@ client_pem = [] [dependencies] async-trait = {workspace = true} -bincode = { version = "^1.3" } +bincode = { version = "^2.0", default-features = false, features = ["serde", "std"] } bytes = {workspace = true} chrono = { workspace= true } config = { workspace = true, features = ["yaml"] } diff --git a/openstack_sdk/src/state.rs b/openstack_sdk/src/state.rs index 85874175e..380d56536 100644 --- a/openstack_sdk/src/state.rs +++ b/openstack_sdk/src/state.rs @@ -245,8 +245,11 @@ impl State { Ok(mut file) => { let mut contents = vec![]; match file.read_to_end(&mut contents) { - Ok(_) => match bincode::deserialize::(&contents) { - Ok(mut auth) => { + Ok(_) => match bincode::serde::decode_from_slice( + &contents, + bincode::config::legacy(), + ) { + Ok::<(ScopeAuths, usize), _>((mut auth, _)) => { auth.filter_invalid_auths(); trace!("Cached Auth info: {:?}", auth); Some(auth) @@ -287,7 +290,7 @@ impl State { let _ = state.0.insert(scope.clone(), data.clone()); - match bincode::serialize(&state) { + match bincode::serde::encode_to_vec(&state, bincode::config::legacy()) { Ok(ser_data) => match File::create(fname.as_path()) { Ok(mut file) => { let _ = file.write_all(&ser_data);