Skip to content

Commit cbc6a6d

Browse files
authored
Fix clippy lint (#765)
* Fix clippy lint
1 parent bc95f50 commit cbc6a6d

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

form_urlencoded/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,7 @@ pub(crate) fn decode_utf8_lossy(input: Cow<'_, [u8]>) -> Cow<'_, str> {
399399
// replace invalid bytes with a placeholder.
400400

401401
// First we do a debug_assert to confirm our description above.
402-
let raw_utf8: *const [u8];
403-
raw_utf8 = utf8.as_bytes();
402+
let raw_utf8: *const [u8] = utf8.as_bytes();
404403
debug_assert!(raw_utf8 == &*bytes as *const [u8]);
405404

406405
// Given we know the original input bytes are valid UTF-8,

percent_encoding/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,7 @@ fn decode_utf8_lossy(input: Cow<'_, [u8]>) -> Cow<'_, str> {
453453
// replace invalid bytes with a placeholder.
454454

455455
// First we do a debug_assert to confirm our description above.
456-
let raw_utf8: *const [u8];
457-
raw_utf8 = utf8.as_bytes();
456+
let raw_utf8: *const [u8] = utf8.as_bytes();
458457
debug_assert!(raw_utf8 == &*bytes as *const [u8]);
459458

460459
// Given we know the original input bytes are valid UTF-8,

url/tests/unit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ fn test_syntax_violation_callback_types() {
799799
("file:/foo.txt", ExpectedFileDoubleSlash, "expected // after file:"),
800800
("file://mozilla.org/c:/file.txt", FileWithHostAndWindowsDrive, "file: with host and Windows drive letter"),
801801
("http://mozilla.org/^", NonUrlCodePoint, "non-URL code point"),
802-
("http://mozilla.org/#\00", NullInFragment, "NULL characters are ignored in URL fragment identifiers"),
802+
("http://mozilla.org/#\x000", NullInFragment, "NULL characters are ignored in URL fragment identifiers"),
803803
("http://mozilla.org/%1", PercentDecode, "expected 2 hex digits after %"),
804804
("http://mozilla.org\t/foo", TabOrNewlineIgnored, "tabs or newlines are ignored in URLs"),
805805
("http://user@:pass@mozilla.org", UnencodedAtSign, "unencoded @ sign in username or password")

0 commit comments

Comments
 (0)