Skip to content
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

Fix lint #911

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions form_urlencoded/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ compile_error!("the `alloc` feature must currently be enabled");

use alloc::borrow::{Borrow, Cow, ToOwned};
use alloc::string::String;
use core::str;
use core::{ptr, str};
use percent_encoding::{percent_decode, percent_encode_byte};

/// Convert a byte string in the `application/x-www-form-urlencoded` syntax
Expand Down Expand Up @@ -411,7 +411,7 @@ pub(crate) fn decode_utf8_lossy(input: Cow<'_, [u8]>) -> Cow<'_, str> {

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

// Given we know the original input bytes are valid UTF-8,
// and we have ownership of those bytes, we re-use them and
Expand Down
4 changes: 2 additions & 2 deletions percent_encoding/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ use alloc::{
string::String,
vec::Vec,
};
use core::{fmt, mem, slice, str};
use core::{fmt, mem, ptr, slice, str};

/// Represents a set of characters or bytes in the ASCII range.
///
Expand Down Expand Up @@ -463,7 +463,7 @@ fn decode_utf8_lossy(input: Cow<'_, [u8]>) -> Cow<'_, str> {

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

// Given we know the original input bytes are valid UTF-8,
// and we have ownership of those bytes, we re-use them and
Expand Down
Loading