From cf6fc1bb75022947677bc01f54f16715e5c88dba Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 11 Jul 2018 10:11:26 +0300 Subject: [PATCH] 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. --- src/protocol/frame/coding.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/protocol/frame/coding.rs b/src/protocol/frame/coding.rs index 5fde5fb..13d9045 100644 --- a/src/protocol/frame/coding.rs +++ b/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,