diff --git a/ruma-common/src/power_levels.rs b/ruma-common/src/power_levels.rs index a835ce84..67bbf4d7 100644 --- a/ruma-common/src/power_levels.rs +++ b/ruma-common/src/power_levels.rs @@ -11,8 +11,8 @@ use serde::{Deserialize, Serialize}; pub struct NotificationPowerLevels { /// The level required to trigger an `@room` notification. /// - /// If you activate the `compat` feature, this field being a string in JSON will give - /// you an `Int` here. + /// If you activate the `compat` feature, deserialization will work for stringified + /// integers too. #[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))] #[serde(default = "default_power_level")] pub room: Int, diff --git a/ruma-events/src/room/power_levels.rs b/ruma-events/src/room/power_levels.rs index 99ff48d5..edd93c19 100644 --- a/ruma-events/src/room/power_levels.rs +++ b/ruma-events/src/room/power_levels.rs @@ -21,8 +21,8 @@ pub type PowerLevelsEvent = StateEvent; pub struct PowerLevelsEventContent { /// The level required to ban a user. /// - /// If you activate the `compat` feature, this field being a string in JSON will give - /// you an `Int` here. + /// If you activate the `compat` feature, deserialization will work for stringified + /// integers too. #[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))] #[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")] #[ruma_event(skip_redaction)] @@ -32,8 +32,8 @@ pub struct PowerLevelsEventContent { /// /// This is a mapping from event type to power level required. /// - /// If you activate the `compat` feature, the value being a string in JSON will give - /// you an `Int` here. + /// If you activate the `compat` feature, deserialization will work for stringified + /// integers too. #[cfg_attr( feature = "compat", serde(deserialize_with = "ruma_serde::btreemap_int_or_string_to_int_values") @@ -44,8 +44,8 @@ pub struct PowerLevelsEventContent { /// The default level required to send message events. /// - /// If you activate the `compat` feature, this field being a string in JSON will give - /// you an `Int` here. + /// If you activate the `compat` feature, deserialization will work for stringified + /// integers too. #[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))] #[serde(default, skip_serializing_if = "ruma_serde::is_default")] #[ruma_event(skip_redaction)] @@ -53,16 +53,16 @@ pub struct PowerLevelsEventContent { /// The level required to invite a user. /// - /// If you activate the `compat` feature, this field being a string in JSON will give - /// you an `Int` here. + /// If you activate the `compat` feature, deserialization will work for stringified + /// integers too. #[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))] #[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")] pub invite: Int, /// The level required to kick a user. /// - /// If you activate the `compat` feature, this field being a string in JSON will give - /// you an `Int` here. + /// If you activate the `compat` feature, deserialization will work for stringified + /// integers too. #[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))] #[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")] #[ruma_event(skip_redaction)] @@ -70,8 +70,8 @@ pub struct PowerLevelsEventContent { /// The level required to redact an event. /// - /// If you activate the `compat` feature, this field being a string in JSON will give - /// you an `Int` here. + /// If you activate the `compat` feature, deserialization will work for stringified + /// integers too. #[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))] #[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")] #[ruma_event(skip_redaction)] @@ -79,8 +79,8 @@ pub struct PowerLevelsEventContent { /// The default level required to send state events. /// - /// If you activate the `compat` feature, this field being a string in JSON will give - /// you an `Int` here. + /// If you activate the `compat` feature, deserialization will work for stringified + /// integers too. #[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))] #[serde(default = "default_power_level", skip_serializing_if = "is_default_power_level")] #[ruma_event(skip_redaction)] @@ -90,8 +90,8 @@ pub struct PowerLevelsEventContent { /// /// This is a mapping from `user_id` to power level for that user. /// - /// If you activate the `compat` feature, the value being a string in JSON will give - /// you an `Int` here. + /// If you activate the `compat` feature, deserialization will work for stringified + /// integers too. #[cfg_attr( feature = "compat", serde(deserialize_with = "ruma_serde::btreemap_int_or_string_to_int_values") @@ -102,8 +102,8 @@ pub struct PowerLevelsEventContent { /// The default power level for every user in the room. /// - /// If you activate the `compat` feature, this field being a string in JSON will give - /// you an `Int` here. + /// If you activate the `compat` feature, deserialization will work for stringified + /// integers too. #[cfg_attr(feature = "compat", serde(deserialize_with = "ruma_serde::int_or_string_to_int"))] #[serde(default, skip_serializing_if = "ruma_serde::is_default")] #[ruma_event(skip_redaction)] diff --git a/ruma/src/lib.rs b/ruma/src/lib.rs index 1ece16d6..94f38a3d 100644 --- a/ruma/src/lib.rs +++ b/ruma/src/lib.rs @@ -7,8 +7,8 @@ //! //! Which crates are re-exported can be configured through cargo features. //! -//! > ⚠ Some details might be missing because of the re-exports so you may need to refer to the -//! other crates' documentations. +//! > ⚠ Some details might be missing because rustdoc has trouble with re-exports so you may need +//! to refer to other crates' documentations. //! //! # API features //! @@ -42,12 +42,12 @@ //! //! By using these features, you opt out of all semver guarantees Ruma otherwise provides: //! -//! * `unstable-exhaustive-types` -- The events in Ruma are marked as non-exhaustive to avoid +//! * `unstable-exhaustive-types` -- Most types in Ruma are marked as non-exhaustive to avoid //! breaking changes when new fields are added in the specification. This feature compiles all //! types as exhaustive. //! * `unstable-pre-spec` -- Upcoming Matrix features that may be subject to change or removal. -//! * `unstable-synapse-quirks` -- Improve compatibility with Synapse homeservers where it deviates -//! from the specification. +//! * `unstable-synapse-quirks` -- Fix issues for clients expecting to connect to Synapse +//! homeservers, at the expense of being less compatible with other homeservers. //! //! # Common features //!