common: Feature-gate part of doctest

This commit is contained in:
Jonas Platte 2022-03-14 10:52:50 +01:00
parent 83e46b6aea
commit 22541ba92f
No known key found for this signature in database
GPG Key ID: BBA95679259D342F

View File

@ -11,8 +11,10 @@ use super::generate_localpart;
/// ```
/// use ruma_common::{device_id, DeviceId};
///
/// # #[cfg(feature = "rand")] {
/// let random_id = DeviceId::new();
/// assert_eq!(random_id.as_str().len(), 8);
/// # }
///
/// let static_id = device_id!("01234567");
/// assert_eq!(static_id.as_str(), "01234567");