mirror of
https://github.com/openharmony/third_party_rust_os_str_bytes.git
synced 2026-07-01 22:03:59 -04:00
Fix new warnings
This commit is contained in:
@@ -42,10 +42,8 @@ pub trait Pattern: private::Sealed {
|
||||
}
|
||||
|
||||
impl Pattern for char {
|
||||
#[doc(hidden)]
|
||||
type __Encoded = EncodedChar;
|
||||
|
||||
#[doc(hidden)]
|
||||
fn __encode(self) -> Self::__Encoded {
|
||||
let mut encoded = EncodedChar {
|
||||
buffer: [0; 4],
|
||||
@@ -57,20 +55,16 @@ impl Pattern for char {
|
||||
}
|
||||
|
||||
impl Pattern for &str {
|
||||
#[doc(hidden)]
|
||||
type __Encoded = Self;
|
||||
|
||||
#[doc(hidden)]
|
||||
fn __encode(self) -> Self::__Encoded {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Pattern for &'a String {
|
||||
#[doc(hidden)]
|
||||
type __Encoded = <&'a str as Pattern>::__Encoded;
|
||||
|
||||
#[doc(hidden)]
|
||||
fn __encode(self) -> Self::__Encoded {
|
||||
(**self).__encode()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user