From ae0f4c4cc541595a814d75443444d4dbc4e53bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Fri, 10 Sep 2021 17:41:33 +0200 Subject: [PATCH] docs(sdk): Add some missing hints for the qrcode feature --- matrix_sdk/src/verification/mod.rs | 2 ++ matrix_sdk/src/verification/requests.rs | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/matrix_sdk/src/verification/mod.rs b/matrix_sdk/src/verification/mod.rs index b59eb706..258d0cfb 100644 --- a/matrix_sdk/src/verification/mod.rs +++ b/matrix_sdk/src/verification/mod.rs @@ -37,6 +37,7 @@ mod sas; pub use matrix_sdk_base::crypto::{AcceptSettings, CancelInfo}; #[cfg(feature = "qrcode")] +#[cfg_attr(feature = "docs", doc(cfg(qrcode)))] pub use qrcode::QrVerification; pub use requests::VerificationRequest; pub use sas::SasVerification; @@ -47,6 +48,7 @@ pub enum Verification { /// The `m.sas.v1` verification variant. SasV1(SasVerification), #[cfg(feature = "qrcode")] + #[cfg_attr(feature = "docs", doc(cfg(qrcode)))] /// The `m.qr_code.*.v1` verification variant. QrV1(QrVerification), } diff --git a/matrix_sdk/src/verification/requests.rs b/matrix_sdk/src/verification/requests.rs index f4a7f6ae..3f1b4894 100644 --- a/matrix_sdk/src/verification/requests.rs +++ b/matrix_sdk/src/verification/requests.rs @@ -85,8 +85,10 @@ impl VerificationRequest { /// Accept the verification request. /// - /// This method will accept the request and signal that it supports the - /// `m.sas.v1`, the `m.qr_code.show.v1`, and `m.reciprocate.v1` method. + /// This method will accept the request and signal by default that it + /// supports the `m.sas.v1`, the `m.qr_code.show.v1`, and `m.reciprocate.v1` + /// method. If the `qrcode` feature is disabled it will only signal that it + /// supports the `m.sas.v1` method. /// /// If QR code scanning should be supported or QR code showing shouldn't be /// supported the [`accept_with_methods()`] method should be used instead. @@ -114,8 +116,9 @@ impl VerificationRequest { Ok(()) } - #[cfg(feature = "qrcode")] /// Generate a QR code + #[cfg(feature = "qrcode")] + #[cfg_attr(feature = "docs", doc(cfg(qrcode)))] pub async fn generate_qr_code(&self) -> Result> { Ok(self .inner