Add documentation to RoomVersionId's PartialOrd, Ord impls
This commit is contained in:
parent
80ab6f0190
commit
d6dfed568f
@ -161,12 +161,22 @@ impl Display for RoomVersionId {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl PartialOrd for RoomVersionId {
|
impl PartialOrd for RoomVersionId {
|
||||||
|
/// Compare the two given room version IDs by comparing their string representations.
|
||||||
|
///
|
||||||
|
/// Please be aware that room version IDs don't have a defined ordering in the Matrix
|
||||||
|
/// specification. This implementation only exists to be able to use `RoomVersionId`s or
|
||||||
|
/// types containing `RoomVersionId`s as `BTreeMap` keys.
|
||||||
fn partial_cmp(&self, other: &RoomVersionId) -> Option<Ordering> {
|
fn partial_cmp(&self, other: &RoomVersionId) -> Option<Ordering> {
|
||||||
self.as_ref().partial_cmp(other.as_ref())
|
self.as_ref().partial_cmp(other.as_ref())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Ord for RoomVersionId {
|
impl Ord for RoomVersionId {
|
||||||
|
/// Compare the two given room version IDs by comparing their string representations.
|
||||||
|
///
|
||||||
|
/// Please be aware that room version IDs don't have a defined ordering in the Matrix
|
||||||
|
/// specification. This implementation only exists to be able to use `RoomVersionId`s or
|
||||||
|
/// types containing `RoomVersionId`s as `BTreeMap` keys.
|
||||||
fn cmp(&self, other: &Self) -> Ordering {
|
fn cmp(&self, other: &Self) -> Ordering {
|
||||||
self.as_ref().cmp(other.as_ref())
|
self.as_ref().cmp(other.as_ref())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user