Skip to content

Commit

Permalink
payload: use match instead of let Ok(..) else
Browse files Browse the repository at this point in the history
To make it pass `tungstenite`'s CI for min Rust version
  • Loading branch information
daniel-abramov committed Dec 11, 2024
1 parent 062b30f commit 663d3da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/protocol/frame/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ impl Payload {
// `Bytes::into()` would not make a copy if our `Bytes` instance is the only one.
let data = mem::take(v).into();
*self = Payload::Owned(data);
let Payload::Owned(v) = self else { unreachable!() };
v
match self {
Payload::Owned(v) => v,
Payload::Shared(_) => unreachable!(),
}
}
}
}
Expand Down

0 comments on commit 663d3da

Please sign in to comment.