mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
layout: Remove TryFrom<Contents> for NonReplacedContents
(#37815)
This implementation is quite confusing as it makes it harder to tell that we are just looking for the case that `Contents` contains `NonReplacedContents`. Testing: This shouldn't have any functional change, so is covered by existing tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
e0af75f265
commit
7375d09887
3 changed files with 55 additions and 77 deletions
|
@ -376,19 +376,6 @@ impl From<NonReplacedContents> for Contents {
|
|||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom<Contents> for NonReplacedContents {
|
||||
type Error = &'static str;
|
||||
|
||||
fn try_from(contents: Contents) -> Result<Self, Self::Error> {
|
||||
match contents {
|
||||
Contents::NonReplaced(non_replaced_contents) => Ok(non_replaced_contents),
|
||||
Contents::Replaced(_) => {
|
||||
Err("Tried to covnert a `Contents::Replaced` into `NonReplacedContent`")
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl NonReplacedContents {
|
||||
pub(crate) fn traverse<'dom>(
|
||||
self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue