1
Fork 0

Delete Utf8Lossy::from_str

This commit is contained in:
David Tolnay 2021-12-08 22:54:51 -08:00
parent e6b883c74f
commit 4b0a9c9bc3
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -12,11 +12,6 @@ pub struct Utf8Lossy {
}
impl Utf8Lossy {
#[must_use]
pub fn from_str(s: &str) -> &Utf8Lossy {
Utf8Lossy::from_bytes(s.as_bytes())
}
#[must_use]
pub fn from_bytes(bytes: &[u8]) -> &Utf8Lossy {
// SAFETY: Both use the same memory layout, and UTF-8 correctness isn't required.