Skip to content

Commit

Permalink
chore(deps): bump quick-xml from 0.36.2 to 0.37.0 (#14)
Browse files Browse the repository at this point in the history
* chore(deps): bump quick-xml from 0.36.2 to 0.37.0

Bumps [quick-xml](https://github.com/tafia/quick-xml) from 0.36.2 to 0.37.0.
- [Release notes](https://github.com/tafia/quick-xml/releases)
- [Changelog](https://github.com/tafia/quick-xml/blob/master/Changelog.md)
- [Commits](tafia/quick-xml@v0.36.2...v0.37.0)

---
updated-dependencies:
- dependency-name: quick-xml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* add specific serialize/deserialize errors

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mark Hähnel <[email protected]>
  • Loading branch information
dependabot[bot] and markhaehnel authored Oct 28, 2024
1 parent 8f7b3e6 commit 9b3f709
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ base64 = { version = "0.22.1" }
cbc = { version = "0.1.2" }
cipher = { version = "0.4.4", features = ["std"] }
md5 = { version = "0.7.0" }
quick-xml = { version = "0.36.2", features = ["serialize"] }
quick-xml = { version = "0.37.0", features = ["serialize"] }
rand = { version = "0.8.5" }
serde = { version = "1.0.213", features = ["derive"] }
thiserror = { version = "1.0.65" }
6 changes: 4 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ pub enum DecryptError {

#[derive(Error, Debug)]
pub enum ParseError {
#[error("invalid xml")]
InvalidSfdl(#[from] quick_xml::DeError),
#[error("invalid xml deserialize")]
InvalidSfdlDeserialize(#[from] quick_xml::DeError),
#[error("invalid xml seriale")]
InvalidSfdlSerialize(#[from] quick_xml::SeError),
}

#[derive(Error, Debug)]
Expand Down
6 changes: 3 additions & 3 deletions src/sfdl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl SfdlFile {
where
R: BufRead,
{
quick_xml::de::from_reader(reader).map_err(ParseError::InvalidSfdl)
quick_xml::de::from_reader(reader).map_err(ParseError::InvalidSfdlDeserialize)
}

/// Read a file from a string.
Expand Down Expand Up @@ -254,7 +254,7 @@ impl SfdlFile {
}

pub fn write<P: AsRef<Path>>(&self, path: P) -> Result<(), SfdlError> {
let content = quick_xml::se::to_string(self).map_err(ParseError::InvalidSfdl)?;
let content = quick_xml::se::to_string(self).map_err(ParseError::InvalidSfdlSerialize)?;
fs::write(path, content)?;

Ok(())
Expand All @@ -265,7 +265,7 @@ impl FromStr for SfdlFile {
type Err = ParseError;

fn from_str(s: &str) -> Result<Self, Self::Err> {
quick_xml::de::from_str(s).map_err(ParseError::InvalidSfdl)
quick_xml::de::from_str(s).map_err(ParseError::InvalidSfdlDeserialize)
}
}

Expand Down

0 comments on commit 9b3f709

Please sign in to comment.