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

@ -3454,10 +3454,10 @@ impl UniqueId {
}
}
impl Into<LayoutNodeType> for NodeTypeId {
impl From<NodeTypeId> for LayoutNodeType {
#[inline(always)]
fn into(self) -> LayoutNodeType {
match self {
fn from(node_type: NodeTypeId) -> LayoutNodeType {
match node_type {
NodeTypeId::Element(e) => LayoutNodeType::Element(e.into()),
NodeTypeId::CharacterData(CharacterDataTypeId::Text(_)) => LayoutNodeType::Text,
x => unreachable!("Layout should not traverse nodes of type {:?}", x),
@ -3465,10 +3465,10 @@ impl Into<LayoutNodeType> for NodeTypeId {
}
}
impl Into<LayoutElementType> for ElementTypeId {
impl From<ElementTypeId> for LayoutElementType {
#[inline(always)]
fn into(self) -> LayoutElementType {
match self {
fn from(element_type: ElementTypeId) -> LayoutElementType {
match element_type {
ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLBodyElement) => {
LayoutElementType::HTMLBodyElement
},