Skip to content

Commit

Permalink
chore(sdk): Rename StickyData::commit to ::on_commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed Aug 23, 2024
1 parent 2ac71fc commit 3a1c374
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/matrix-sdk/src/sliding_sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ impl StickyData for SlidingSyncStickyParameters {
request.extensions = self.extensions.clone();
}

fn commit(&mut self) {
fn on_commit(&mut self) {
// All room subscriptions are marked as `Applied`.
for (state, _room_subscription) in self.room_subscriptions.values_mut() {
if matches!(state, RoomSubscriptionState::Pending) {
Expand Down
10 changes: 5 additions & 5 deletions crates/matrix-sdk/src/sliding_sync/sticky_parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ pub trait StickyData {
/// Apply the current data onto the request.
fn apply(&self, request: &mut Self::Request);

/// Commit the current data, i.e. the request has been validated by a
/// response.
fn commit(&mut self) {
/// When the current are committed, i.e. when the request has been validated
/// by a response.
fn on_commit(&mut self) {
// noop
}
}
Expand Down Expand Up @@ -128,7 +128,7 @@ impl<D: StickyData> SlidingSyncStickyManager<D> {
pub fn maybe_commit(&mut self, txn_id: &TransactionId) {
if self.invalidated && self.txn_id.as_deref() == Some(txn_id) {
self.invalidated = false;
self.data.commit();
self.data.on_commit();
}
}

Expand All @@ -152,7 +152,7 @@ mod tests {
*req = true;
}

fn commit(&mut self) {
fn on_commit(&mut self) {
self.0 += 1;
}
}
Expand Down

0 comments on commit 3a1c374

Please sign in to comment.