From 2ad291ceb0e2d94576f6822d002a851de40ba832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 13 Sep 2023 19:48:33 +0200 Subject: [PATCH] events: Use the default value of canonical in SpaceParentEventContent's constructor --- crates/ruma-events/src/space/parent.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/ruma-events/src/space/parent.rs b/crates/ruma-events/src/space/parent.rs index 429bae28..1a33a2ee 100644 --- a/crates/ruma-events/src/space/parent.rs +++ b/crates/ruma-events/src/space/parent.rs @@ -27,14 +27,16 @@ pub struct SpaceParentEventContent { /// together. In practice, well behaved rooms should only have one `canonical` parent, but /// given this is not enforced: if multiple are present the client should select the one with /// the lowest room ID, as determined via a lexicographic ordering of the Unicode code-points. + /// + /// Defaults to `false`. #[serde(default, skip_serializing_if = "ruma_common::serde::is_default")] pub canonical: bool, } impl SpaceParentEventContent { - /// Creates a new `SpaceParentEventContent` with the given routing servers and canonical flag. - pub fn new(via: Vec, canonical: bool) -> Self { - Self { via, canonical } + /// Creates a new `SpaceParentEventContent` with the given routing servers. + pub fn new(via: Vec) -> Self { + Self { via, canonical: false } } }