frame: change CloseCode::is_allowed to by-value

It's a small copy type so copying is more conventional.

warning: this argument is passed by reference, but would be more efficient if passed by value
   --> src/protocol/frame/coding.rs:186:23
    |
186 |     pub fn is_allowed(&self) -> bool {
    |                       ^^^^^ help: consider passing by value instead: `self`
    |
    = note: #[warn(trivially_copy_pass_by_ref)] on by default
    = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#trivially_copy_pass_by_ref

This is a breaking change.
pull/39/head
Ran Benita 7 years ago
parent 3fd52147f3
commit cf6fc1bb75
  1. 4
      src/protocol/frame/coding.rs

@ -183,8 +183,8 @@ pub enum CloseCode {
impl CloseCode {
/// Check if this CloseCode is allowed.
pub fn is_allowed(&self) -> bool {
match *self {
pub fn is_allowed(self) -> bool {
match self {
Bad(_) => false,
Reserved(_) => false,
Status => false,

Loading…
Cancel
Save