Skip to content

Commit 3df336a

Browse files
committed
refactor(widget): get rid of function used only once
1 parent 12e358a commit 3df336a

File tree

1 file changed

+1
-8
lines changed
  • crates/matrix-sdk/src/widget/machine

1 file changed

+1
-8
lines changed

crates/matrix-sdk/src/widget/machine/mod.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl WidgetMachine {
230230
FromWidgetRequest::ContentLoaded {} => {
231231
let mut response =
232232
vec![Self::send_from_widget_response(raw_request, Ok(JsonObject::new()))];
233-
if self.capabilities.is_unset() {
233+
if matches!(self.capabilities, CapabilitiesState::Unset) {
234234
response.append(&mut self.negotiate_capabilities());
235235
}
236236
response
@@ -665,10 +665,3 @@ enum CapabilitiesState {
665665
/// The capabilities have already been negotiated.
666666
Negotiated(Capabilities),
667667
}
668-
669-
impl CapabilitiesState {
670-
#[must_use]
671-
fn is_unset(&self) -> bool {
672-
matches!(self, Self::Unset)
673-
}
674-
}

0 commit comments

Comments
 (0)