minidom: Fix most issues reported by clippy

This improves some of our internals.

skip-changelog: These changes are purely internal.
This commit is contained in:
Emmanuel Gil Peyrot 2025-02-25 02:01:20 +01:00 committed by pep
commit af14717ddc
4 changed files with 43 additions and 19 deletions

View file

@ -48,10 +48,10 @@ impl StdError for Error {
match self {
Error::XmlError(e) => Some(e),
Error::Io(e) => Some(e),
Error::EndOfDocument => None,
Error::InvalidPrefix => None,
Error::MissingNamespace => None,
Error::DuplicatePrefix => None,
Error::EndOfDocument
| Error::InvalidPrefix
| Error::MissingNamespace
| Error::DuplicatePrefix => None,
}
}
}
@ -68,8 +68,8 @@ impl From<io::Error> for Error {
impl fmt::Display for Error {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::XmlError(e) => write!(fmt, "XML error: {}", e),
Error::Io(e) => write!(fmt, "I/O error: {}", e),
Error::XmlError(e) => write!(fmt, "XML error: {e}"),
Error::Io(e) => write!(fmt, "I/O error: {e}"),
Error::EndOfDocument => {
write!(fmt, "the end of the document has been reached prematurely")
}