Skip to content

refactor: remove unnecessary Cow::Borrowed wrapper in URL query parsing #696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ice/src/url/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#[cfg(test)]
mod url_test;

use std::borrow::Cow;
use std::convert::From;
use std::fmt;

Expand Down Expand Up @@ -190,7 +189,7 @@ impl Url {
return Err(Error::ErrInvalidQuery);
}
if let Some((key, value)) = q_args.next() {
if key == Cow::Borrowed("transport") {
if key == "transport" {
let proto: ProtoType = value.as_ref().into();
if proto == ProtoType::Unknown {
return Err(Error::ErrProtoType);
Expand All @@ -208,7 +207,7 @@ impl Url {
return Err(Error::ErrInvalidQuery);
}
if let Some((key, value)) = q_args.next() {
if key == Cow::Borrowed("transport") {
if key == "transport" {
let proto: ProtoType = value.as_ref().into();
if proto == ProtoType::Unknown {
return Err(Error::ErrProtoType);
Expand Down
Loading