Skip to content

Commit efdeba7

Browse files
committed
chore: Upgrade workspace dependencies
1 parent e25061f commit efdeba7

File tree

5 files changed

+124
-88
lines changed

5 files changed

+124
-88
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ rust-version = "1.65"
2323
anyhow = "1.0.68"
2424
async-stream = "0.3.3"
2525
async-trait = "0.1.60"
26-
base64 = "0.20.0"
26+
base64 = "0.21.0"
2727
byteorder = "1.4.3"
2828
ctor = "0.1.26"
2929
dashmap = "5.2.0"
3030
http = "0.2.6"
31-
ruma = { git = "https://github.com/ruma/ruma", rev = "00045e559f864eabff08295d603f7b3238288b6f", features = ["client-api-c"] }
32-
ruma-common = { git = "https://github.com/ruma/ruma", rev = "00045e559f864eabff08295d603f7b3238288b6f" }
31+
ruma = { version = "0.8.0", features = ["client-api-c"] }
32+
ruma-common = "0.11.2"
3333
once_cell = "1.16.0"
3434
serde = "1.0.151"
3535
serde_html_form = "0.2.0"

bindings/matrix-sdk-crypto-ffi/src/verification.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
use std::sync::Arc;
22

33
use base64::{
4-
alphabet, decode_engine, encode_engine,
5-
engine::fast_portable::{self, FastPortable},
4+
alphabet,
5+
engine::{general_purpose, GeneralPurpose},
6+
Engine,
67
};
78
use futures_util::{Stream, StreamExt};
89
use matrix_sdk_crypto::{
@@ -16,8 +17,8 @@ use tokio::runtime::Handle;
1617

1718
use crate::{CryptoStoreError, OutgoingVerificationRequest, SignatureUploadRequest};
1819

19-
const STANDARD_NO_PAD: FastPortable =
20-
FastPortable::from(&alphabet::STANDARD, fast_portable::NO_PAD);
20+
const STANDARD_NO_PAD: GeneralPurpose =
21+
GeneralPurpose::new(&alphabet::STANDARD, general_purpose::NO_PAD);
2122

2223
/// Listener that will be passed over the FFI to report changes to a SAS
2324
/// verification.
@@ -407,7 +408,7 @@ impl QrCode {
407408
/// decoded on the other side before it can be put through a QR code
408409
/// generator.
409410
pub fn generate_qr_code(&self) -> Option<String> {
410-
self.inner.to_bytes().map(|data| encode_engine(data, &STANDARD_NO_PAD)).ok()
411+
self.inner.to_bytes().map(|data| STANDARD_NO_PAD.encode(data)).ok()
411412
}
412413

413414
/// Set a listener for changes in the QrCode verification process.
@@ -709,7 +710,7 @@ impl VerificationRequest {
709710
/// * `data` - The data that was extracted from the scanned QR code as an
710711
/// base64 encoded string, without padding.
711712
pub fn scan_qr_code(&self, data: &str) -> Option<ScanResult> {
712-
let data = decode_engine(data, &STANDARD_NO_PAD).ok()?;
713+
let data = STANDARD_NO_PAD.decode(data).ok()?;
713714
let data = QrVerificationData::from_bytes(data).ok()?;
714715

715716
if let Some(qr) = self.runtime.block_on(self.inner.scan_qr_code(data)).ok()? {

crates/matrix-sdk-crypto/src/utilities.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,23 @@ use std::{
2222

2323
pub use base64::DecodeError;
2424
use base64::{
25-
alphabet, decode_engine, encode_engine,
26-
engine::fast_portable::{self, FastPortable},
25+
alphabet,
26+
engine::{general_purpose, GeneralPurpose},
27+
Engine,
2728
};
2829
use matrix_sdk_common::instant::Instant;
2930

30-
const STANDARD_NO_PAD: FastPortable =
31-
FastPortable::from(&alphabet::STANDARD, fast_portable::NO_PAD);
31+
const STANDARD_NO_PAD: GeneralPurpose =
32+
GeneralPurpose::new(&alphabet::STANDARD, general_purpose::NO_PAD);
3233

3334
/// Decode the input as base64 with no padding.
3435
pub fn decode(input: impl AsRef<[u8]>) -> Result<Vec<u8>, DecodeError> {
35-
decode_engine(input, &STANDARD_NO_PAD)
36+
STANDARD_NO_PAD.decode(input)
3637
}
3738

3839
/// Encode the input as base64 with no padding.
3940
pub fn encode(input: impl AsRef<[u8]>) -> String {
40-
encode_engine(input, &STANDARD_NO_PAD)
41+
STANDARD_NO_PAD.encode(input)
4142
}
4243

4344
#[cfg(test)]

0 commit comments

Comments
 (0)