build: bump quick-xml from 0.23.0 to 0.24.0 (#4322)

* build: bump quick-xml from 0.23.0 to 0.24.0

Bumps [quick-xml](https://github.com/tafia/quick-xml) from 0.23.0 to 0.24.0.
- [Release notes](https://github.com/tafia/quick-xml/releases)
- [Changelog](https://github.com/tafia/quick-xml/blob/master/Changelog.md)
- [Commits](https://github.com/tafia/quick-xml/compare/v0.23.0...v0.24.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

* switch to updated apis

* run cargo update

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
David Knaack
2022-08-30 22:36:44 +02:00
committed by GitHub
parent defb5a04a3
commit c40f0e7722
4 changed files with 163 additions and 183 deletions
+10 -4
View File
@@ -105,13 +105,13 @@ fn get_tfm_from_project_file(path: &Path) -> Option<String> {
let mut buf = Vec::new();
loop {
match reader.read_event(&mut buf) {
match reader.read_event_into(&mut buf) {
// for triggering namespaced events, use this instead:
// match reader.read_namespaced_event(&mut buf) {
Ok(Event::Start(ref e)) => {
// for namespaced:
// Ok((ref namespace_value, Event::Start(ref e)))
match e.name() {
match e.name().as_ref() {
b"TargetFrameworks" => in_tfm = true,
b"TargetFramework" => in_tfm = true,
_ => in_tfm = false,
@@ -120,11 +120,17 @@ fn get_tfm_from_project_file(path: &Path) -> Option<String> {
// unescape and decode the text event using the reader encoding
Ok(Event::Text(e)) => {
if in_tfm {
return e.unescape_and_decode(&reader).ok();
return e.unescape().ok().map(|s| s.into_owned());
}
}
Ok(Event::Eof) => break, // exits the loop when reaching end of file
Err(e) => panic!("Error at position {}: {:?}", reader.buffer_position(), e),
Err(e) => {
log::error!(
"Error parsing project file {path:?} at position {pos}: {e:?}",
pos = reader.buffer_position()
);
return None;
}
_ => (), // There are several other `Event`s we do not consider here
}
+3 -3
View File
@@ -150,9 +150,9 @@ fn get_maven_version(context: &Context, config: &PackageConfig) -> Option<String
let mut in_ver = false;
let mut depth = 0;
loop {
match reader.read_event(&mut buf) {
match reader.read_event_into(&mut buf) {
Ok(QXEvent::Start(ref e)) => {
in_ver = depth == 1 && e.name() == b"version";
in_ver = depth == 1 && e.name().as_ref() == b"version";
depth += 1;
}
Ok(QXEvent::End(_)) => {
@@ -160,7 +160,7 @@ fn get_maven_version(context: &Context, config: &PackageConfig) -> Option<String
depth -= 1;
}
Ok(QXEvent::Text(t)) if in_ver => {
let ver = t.unescape_and_decode(&reader).ok();
let ver = t.unescape().ok().map(|s| s.into_owned());
return match ver {
// Ignore version which is just a property reference
Some(ref v) if !v.starts_with('$') => format_version(v, config.version_format),