Add the unstable-pre-spec feature to the federation-api crate
This commit is contained in:
parent
3f7c6f6bea
commit
c04a9e71c5
@ -30,3 +30,4 @@ matches = "0.1.8"
|
|||||||
|
|
||||||
[features]
|
[features]
|
||||||
unstable-exhaustive-types = []
|
unstable-exhaustive-types = []
|
||||||
|
unstable-pre-spec = []
|
||||||
|
@ -23,9 +23,23 @@ pub struct RoomState {
|
|||||||
pub state: Vec<Raw<Pdu>>,
|
pub state: Vec<Raw<Pdu>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "unstable-pre-spec")]
|
||||||
|
impl Default for RoomState {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl RoomState {
|
impl RoomState {
|
||||||
|
#[cfg(not(feature = "unstable-pre-spec"))]
|
||||||
/// Creates an empty `RoomState` with the given `origin`.
|
/// Creates an empty `RoomState` with the given `origin`.
|
||||||
pub fn new(origin: String) -> Self {
|
pub fn new(origin: String) -> Self {
|
||||||
Self { origin, auth_chain: Vec::new(), state: Vec::new() }
|
Self { origin, auth_chain: Vec::new(), state: Vec::new() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "unstable-pre-spec")]
|
||||||
|
/// Creates an empty `RoomState` with the given `origin`.
|
||||||
|
pub fn new() -> Self {
|
||||||
|
Self { auth_chain: Vec::new(), state: Vec::new() }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ unstable-exhaustive-types = [
|
|||||||
"ruma-federation-api/unstable-exhaustive-types",
|
"ruma-federation-api/unstable-exhaustive-types",
|
||||||
"ruma-common/unstable-exhaustive-types",
|
"ruma-common/unstable-exhaustive-types",
|
||||||
]
|
]
|
||||||
unstable-pre-spec = ["ruma-client-api/unstable-pre-spec", "ruma-events/unstable-pre-spec"]
|
unstable-pre-spec = ["ruma-client-api/unstable-pre-spec", "ruma-events/unstable-pre-spec", "ruma-federation-api/unstable-pre-spec"]
|
||||||
unstable-synapse-quirks = [
|
unstable-synapse-quirks = [
|
||||||
"ruma-client-api/unstable-synapse-quirks",
|
"ruma-client-api/unstable-synapse-quirks",
|
||||||
"ruma-common/unstable-synapse-quirks",
|
"ruma-common/unstable-synapse-quirks",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user