identifiers: Merge more impl blocks

This commit is contained in:
Jonas Platte 2021-09-23 18:50:02 +02:00
parent 79cbce00cc
commit 27a2e1f97f
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67
2 changed files with 0 additions and 4 deletions

View File

@ -65,9 +65,7 @@ impl EventId {
Self { full_id, colon_idx: NonZeroU8::new(19) } Self { full_id, colon_idx: NonZeroU8::new(19) }
} }
}
impl EventId {
/// Returns the event's unique ID. For the original event format as used by Matrix room /// Returns the event's unique ID. For the original event format as used by Matrix room
/// versions 1 and 2, this is the "localpart" that precedes the homeserver. For later formats, /// versions 1 and 2, this is the "localpart" that precedes the homeserver. For later formats,
/// this is the entire ID without the leading $ sigil. /// this is the entire ID without the leading $ sigil.

View File

@ -43,9 +43,7 @@ impl RoomId {
Self { full_id, colon_idx: NonZeroU8::new(19).unwrap() } Self { full_id, colon_idx: NonZeroU8::new(19).unwrap() }
} }
}
impl RoomId {
/// Returns the rooms's unique ID. /// Returns the rooms's unique ID.
pub fn localpart(&self) -> &str { pub fn localpart(&self) -> &str {
&self.full_id[1..self.colon_idx.get() as usize] &self.full_id[1..self.colon_idx.get() as usize]