Skip to content

Commit c4f8623

Browse files
authored
refactor: remove unnecessary Cow::Borrowed wrapper in URL query parsing (#696)
Signed-off-by: Xiaobo Liu <[email protected]>
1 parent f98714e commit c4f8623

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ice/src/url/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#[cfg(test)]
22
mod url_test;
33

4-
use std::borrow::Cow;
54
use std::convert::From;
65
use std::fmt;
76

@@ -190,7 +189,7 @@ impl Url {
190189
return Err(Error::ErrInvalidQuery);
191190
}
192191
if let Some((key, value)) = q_args.next() {
193-
if key == Cow::Borrowed("transport") {
192+
if key == "transport" {
194193
let proto: ProtoType = value.as_ref().into();
195194
if proto == ProtoType::Unknown {
196195
return Err(Error::ErrProtoType);
@@ -208,7 +207,7 @@ impl Url {
208207
return Err(Error::ErrInvalidQuery);
209208
}
210209
if let Some((key, value)) = q_args.next() {
211-
if key == Cow::Borrowed("transport") {
210+
if key == "transport" {
212211
let proto: ProtoType = value.as_ref().into();
213212
if proto == ProtoType::Unknown {
214213
return Err(Error::ErrProtoType);

0 commit comments

Comments
 (0)