mirror of
https://github.com/element-hq/synapse.git
synced 2026-06-04 12:31:23 +00:00
Store calculated room ID on top-level
Rather than validating and then re-calcualting it every time, let's just store it on the top-level.
This commit is contained in:
@@ -64,6 +64,14 @@ impl<T> AllowMissing<T> {
|
||||
AllowMissing::Absent => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Converts to `Option<&T>`.
|
||||
pub fn as_ref_opt(&self) -> Option<&T> {
|
||||
match self {
|
||||
AllowMissing::Some(inner) => Some(inner),
|
||||
AllowMissing::Absent => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A module that provides the serialization and deserialization logic for
|
||||
|
||||
Reference in New Issue
Block a user