clippy: Fix from_over_into warnings (#31946)

This commit is contained in:
eri 2024-03-30 12:30:14 +01:00 committed by GitHub
parent e3d6b66d5f
commit a7ad92d9a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 24 additions and 24 deletions

View file

@ -543,9 +543,9 @@ pub enum ProtoOrIfaceIndex {
Constructor(PrototypeList::Constructor),
}
impl Into<usize> for ProtoOrIfaceIndex {
fn into(self) -> usize {
match self {
impl From<ProtoOrIfaceIndex> for usize {
fn from(index: ProtoOrIfaceIndex) -> usize {
match index {
ProtoOrIfaceIndex::ID(id) => id as usize,
ProtoOrIfaceIndex::Constructor(constructor) => constructor as usize,
}

View file

@ -51,9 +51,9 @@ impl ByteString {
}
}
impl Into<Vec<u8>> for ByteString {
fn into(self) -> Vec<u8> {
self.0
impl From<ByteString> for Vec<u8> {
fn from(byte_string: ByteString) -> Vec<u8> {
byte_string.0
}
}
@ -640,21 +640,21 @@ impl From<DOMString> for String {
}
}
impl Into<Vec<u8>> for DOMString {
fn into(self) -> Vec<u8> {
self.0.into()
impl From<DOMString> for Vec<u8> {
fn from(contents: DOMString) -> Vec<u8> {
contents.0.into()
}
}
impl<'a> Into<Cow<'a, str>> for DOMString {
fn into(self) -> Cow<'a, str> {
self.0.into()
impl<'a> From<DOMString> for Cow<'a, str> {
fn from(contents: DOMString) -> Cow<'a, str> {
contents.0.into()
}
}
impl<'a> Into<CowRcStr<'a>> for DOMString {
fn into(self) -> CowRcStr<'a> {
self.0.into()
impl<'a> From<DOMString> for CowRcStr<'a> {
fn from(contents: DOMString) -> CowRcStr<'a> {
contents.0.into()
}
}