mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-06-11 01:44:23 -04:00
Fix some doc tests
This commit is contained in:
@@ -249,7 +249,7 @@ impl RehydratedDevice {
|
||||
/// // Rehydrate the device.
|
||||
/// let rehydrated = machine
|
||||
/// .dehydrated_devices()
|
||||
/// .rehydrate(&pickle_key, &device_id, response.device_data)
|
||||
/// .rehydrate(&pickle_key, &device_id, response.device_data, None)
|
||||
/// .await?;
|
||||
///
|
||||
/// let mut since_token = None;
|
||||
|
||||
@@ -374,7 +374,7 @@ pub enum RoomEventDecryptionResult {
|
||||
/// let user_id = user_id!("@alice:localhost");
|
||||
/// let device_id = "DEVICEID".into();
|
||||
///
|
||||
/// let machine = OlmMachine::new(user_id, device_id).await;
|
||||
/// let machine = OlmMachine::new(user_id, device_id, None).await;
|
||||
/// # Ok(())
|
||||
/// # }
|
||||
/// ```
|
||||
|
||||
@@ -2693,7 +2693,7 @@ impl OlmMachine {
|
||||
/// # use ruma::{device_id, owned_user_id};
|
||||
/// # let alice = owned_user_id!("@alice:example.org");
|
||||
/// # futures_executor::block_on(async {
|
||||
/// # let machine = OlmMachine::new(&alice, device_id!("DEVICEID")).await;
|
||||
/// # let machine = OlmMachine::new(&alice, device_id!("DEVICEID"), None).await;
|
||||
/// let device = machine.get_device(&alice, device_id!("DEVICEID"), None).await;
|
||||
///
|
||||
/// println!("{:?}", device);
|
||||
@@ -2751,7 +2751,7 @@ impl OlmMachine {
|
||||
/// # use ruma::{device_id, owned_user_id};
|
||||
/// # let alice = owned_user_id!("@alice:example.org");
|
||||
/// # futures_executor::block_on(async {
|
||||
/// # let machine = OlmMachine::new(&alice, device_id!("DEVICEID")).await;
|
||||
/// # let machine = OlmMachine::new(&alice, device_id!("DEVICEID"), None).await;
|
||||
/// let devices = machine.get_user_devices(&alice, None).await.unwrap();
|
||||
///
|
||||
/// for device in devices.devices() {
|
||||
|
||||
@@ -1383,7 +1383,7 @@ impl Store {
|
||||
/// # use futures_util::{pin_mut, StreamExt};
|
||||
/// # let alice = owned_user_id!("@alice:example.org");
|
||||
/// # futures_executor::block_on(async {
|
||||
/// # let machine = OlmMachine::new(&alice, device_id!("DEVICEID")).await;
|
||||
/// # let machine = OlmMachine::new(&alice, device_id!("DEVICEID"), None).await;
|
||||
///
|
||||
/// let secret_stream = machine.store().secrets_stream();
|
||||
/// pin_mut!(secret_stream);
|
||||
@@ -1419,7 +1419,7 @@ impl Store {
|
||||
/// # use futures_util::{pin_mut, StreamExt};
|
||||
/// # let alice = owned_user_id!("@alice:example.org");
|
||||
/// # async {
|
||||
/// # let machine = OlmMachine::new(&alice, device_id!("DEVICEID")).await;
|
||||
/// # let machine = OlmMachine::new(&alice, device_id!("DEVICEID"), None).await;
|
||||
/// let bundle_stream = machine.store().historic_room_key_stream();
|
||||
/// pin_mut!(bundle_stream);
|
||||
///
|
||||
@@ -1495,7 +1495,7 @@ impl Store {
|
||||
/// # use ruma::{device_id, user_id};
|
||||
/// # let alice = user_id!("@alice:example.org");
|
||||
/// # async {
|
||||
/// # let machine = OlmMachine::new(&alice, device_id!("DEVICEID")).await;
|
||||
/// # let machine = OlmMachine::new(&alice, device_id!("DEVICEID"), None).await;
|
||||
/// # let export = Cursor::new("".to_owned());
|
||||
/// let exported_keys = decrypt_room_key_export(export, "1234").unwrap();
|
||||
/// machine.store().import_exported_room_keys(exported_keys, |_, _| {}).await.unwrap();
|
||||
@@ -1573,7 +1573,7 @@ impl Store {
|
||||
/// # use ruma::{device_id, user_id, room_id};
|
||||
/// # let alice = user_id!("@alice:example.org");
|
||||
/// # async {
|
||||
/// # let machine = OlmMachine::new(&alice, device_id!("DEVICEID")).await;
|
||||
/// # let machine = OlmMachine::new(&alice, device_id!("DEVICEID"), None).await;
|
||||
/// let room_id = room_id!("!test:localhost");
|
||||
/// let exported_keys = machine.store().export_room_keys(|s| s.room_id() == room_id).await.unwrap();
|
||||
/// let encrypted_export = encrypt_room_key_export(&exported_keys, "1234", 1);
|
||||
@@ -1616,7 +1616,7 @@ impl Store {
|
||||
/// use tokio_stream::StreamExt;
|
||||
/// # async {
|
||||
/// let alice = user_id!("@alice:example.org");
|
||||
/// let machine = OlmMachine::new(&alice, device_id!("DEVICEID")).await;
|
||||
/// let machine = OlmMachine::new(&alice, device_id!("DEVICEID"), None).await;
|
||||
/// let room_id = room_id!("!test:localhost");
|
||||
/// let mut keys = pin!(
|
||||
/// machine
|
||||
|
||||
Reference in New Issue
Block a user