thirdparty: Fix unstable-unspecified feature being non-additive
This commit is contained in:
parent
6347f547c1
commit
64b3838113
@ -1,5 +1,11 @@
|
|||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
Bug fixes:
|
||||||
|
|
||||||
|
- The `instance_id` field was removed from `ProtocolInstanceInit` and is now an
|
||||||
|
`Option<String>` for `ProtocolInstance`. It made the `unstable-unspecified`
|
||||||
|
feature non-additive.
|
||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
|
|
||||||
- Add the `InvalidHeaderValue` variant to the `DeserializationError` struct, for
|
- Add the `InvalidHeaderValue` variant to the `DeserializationError` struct, for
|
||||||
|
@ -91,7 +91,8 @@ pub struct ProtocolInstance {
|
|||||||
///
|
///
|
||||||
/// See [matrix-spec#833](https://github.com/matrix-org/matrix-spec/issues/833).
|
/// See [matrix-spec#833](https://github.com/matrix-org/matrix-spec/issues/833).
|
||||||
#[cfg(feature = "unstable-unspecified")]
|
#[cfg(feature = "unstable-unspecified")]
|
||||||
pub instance_id: String,
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub instance_id: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Initial set of fields of `Protocol`.
|
/// Initial set of fields of `Protocol`.
|
||||||
@ -109,30 +110,18 @@ pub struct ProtocolInstanceInit {
|
|||||||
|
|
||||||
/// A unique identifier across all instances.
|
/// A unique identifier across all instances.
|
||||||
pub network_id: String,
|
pub network_id: String,
|
||||||
|
|
||||||
/// A unique identifier across all instances.
|
|
||||||
///
|
|
||||||
/// See [matrix-spec#833](https://github.com/matrix-org/matrix-spec/issues/833).
|
|
||||||
#[cfg(feature = "unstable-unspecified")]
|
|
||||||
pub instance_id: String,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<ProtocolInstanceInit> for ProtocolInstance {
|
impl From<ProtocolInstanceInit> for ProtocolInstance {
|
||||||
fn from(init: ProtocolInstanceInit) -> Self {
|
fn from(init: ProtocolInstanceInit) -> Self {
|
||||||
let ProtocolInstanceInit {
|
let ProtocolInstanceInit { desc, fields, network_id } = init;
|
||||||
desc,
|
|
||||||
fields,
|
|
||||||
network_id,
|
|
||||||
#[cfg(feature = "unstable-unspecified")]
|
|
||||||
instance_id,
|
|
||||||
} = init;
|
|
||||||
Self {
|
Self {
|
||||||
desc,
|
desc,
|
||||||
icon: None,
|
icon: None,
|
||||||
fields,
|
fields,
|
||||||
network_id,
|
network_id,
|
||||||
#[cfg(feature = "unstable-unspecified")]
|
#[cfg(feature = "unstable-unspecified")]
|
||||||
instance_id,
|
instance_id: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user