matrix-sdk: Don't ignore the accept_with_settings() Sas example

master
Damir Jelić 2021-03-23 14:30:31 +01:00
parent e92b97eff6
commit ce4b809072
1 changed files with 11 additions and 2 deletions

View File

@ -39,15 +39,24 @@ impl Sas {
/// ///
/// # Examples /// # Examples
/// ///
/// ```ignore /// ```no_run
/// # use matrix_sdk::Client;
/// # use futures::executor::block_on;
/// # use url::Url;
/// use matrix_sdk::Sas; /// use matrix_sdk::Sas;
/// use matrix_sdk_base::crypto::AcceptSettings; /// use matrix_sdk_base::crypto::AcceptSettings;
/// use matrix_sdk::events::key::verification::ShortAuthenticationString; /// use matrix_sdk::events::key::verification::ShortAuthenticationString;
/// # let homeserver = Url::parse("http://example.com").unwrap();
/// # let client = Client::new(homeserver).unwrap();
/// # let flow_id = "someID";
/// # block_on(async {
/// let sas = client.get_verification(flow_id).await.unwrap();
/// ///
/// let only_decimal = AcceptSettings::with_allowed_methods( /// let only_decimal = AcceptSettings::with_allowed_methods(
/// vec![ShortAuthenticationString::Decimal] /// vec![ShortAuthenticationString::Decimal]
/// ); /// );
/// sas.accept_with_settings(only_decimal); /// sas.accept_with_settings(only_decimal).await.unwrap();
/// # });
/// ``` /// ```
pub async fn accept_with_settings(&self, settings: AcceptSettings) -> Result<()> { pub async fn accept_with_settings(&self, settings: AcceptSettings) -> Result<()> {
if let Some(req) = self.inner.accept_with_settings(settings) { if let Some(req) = self.inner.accept_with_settings(settings) {