Skip to content

Commit

Permalink
lint(needless_late_init): decode_utf8_lossy
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronO committed Apr 10, 2022
1 parent 48fcbe1 commit 8442397
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions form_urlencoded/src/lib.rs
Expand Up @@ -399,8 +399,7 @@ pub(crate) fn decode_utf8_lossy(input: Cow<'_, [u8]>) -> Cow<'_, str> {
// replace invalid bytes with a placeholder.

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

// Given we know the original input bytes are valid UTF-8,
Expand Down
3 changes: 1 addition & 2 deletions percent_encoding/src/lib.rs
Expand Up @@ -453,8 +453,7 @@ fn decode_utf8_lossy(input: Cow<'_, [u8]>) -> Cow<'_, str> {
// replace invalid bytes with a placeholder.

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

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

0 comments on commit 8442397

Please sign in to comment.