mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-12 10:00:50 -04:00
chore(comment): fix the comment for Error::CannotModifyRanges
The comment and the check in the code were contradicting each other; the comment was wrong, and the code was right, so there's that. Signed-off-by: Benjamin Bouvier <public@benj.me>
This commit is contained in:
@@ -19,9 +19,9 @@ pub enum Error {
|
||||
#[error("The sliding sync list `{0}` is handling a response, but its request generator has not been initialized")]
|
||||
RequestGeneratorHasNotBeenInitialized(String),
|
||||
|
||||
/// Someone has tried to modify a sliding sync list's ranges, but the
|
||||
/// selected sync mode doesn't allow that.
|
||||
#[error("The chosen sync mode for the list `{0}` doesn't allow to modify the ranges")]
|
||||
/// Someone has tried to modify a sliding sync list's ranges, but only the
|
||||
/// `Selective` sync mode does allow that.
|
||||
#[error("The chosen sync mode for the list `{0}` doesn't allow to modify the ranges; only `Selective` allows that")]
|
||||
CannotModifyRanges(String),
|
||||
|
||||
/// Ranges have a `start` bound greater than `end`.
|
||||
|
||||
@@ -912,6 +912,8 @@ pub enum SlidingSyncMode {
|
||||
impl SlidingSyncMode {
|
||||
/// Return whether an external caller can modify the sync mode's ranges.
|
||||
fn ranges_can_be_modified_by_user(&self) -> bool {
|
||||
// If this gets modified, don't forget to update the `Error::CannotModifyRanges`
|
||||
// error message.
|
||||
matches!(self, Self::Selective)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user