diff --git a/CHANGELOG.md b/CHANGELOG.md index 03bcbaf7e..b808e51dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,13 @@ # Change Log -## [0.3.3] (in development) +## [0.3.4] (in development) + +## [0.3.3] 2023-17-07 ### Changed -* Update the implementation of StructuredError so that all validation errors are returned from the validation methods present on `SchemaValidationContext`. Previously, all returned validation errors were identical due to libxml reusing a global memory address for all reported errors. +* Update the implementation of `StructuredError` so that all validation errors are returned from the validation methods present on `SchemaValidationContext`. Previously, all returned validation errors were identical due to libxml reusing a global memory address for all reported errors. Thanks @JDSeiler ! +* The `message` method of `StructuredError` has been deprecated. ## [0.3.2] 2023-07-05 diff --git a/Cargo.toml b/Cargo.toml index 417dc5c54..95cb05c5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libxml" -version = "0.3.2" +version = "0.3.3" edition = "2021" authors = ["Andreas Franzén ", "Deyan Ginev ","Jan Frederik Schaefer "] description = "A Rust wrapper for libxml2 - the XML C parser and toolkit developed for the Gnome project" diff --git a/src/schemas/parser.rs b/src/schemas/parser.rs index 7c84a4a73..e6a496de7 100644 --- a/src/schemas/parser.rs +++ b/src/schemas/parser.rs @@ -61,7 +61,7 @@ impl SchemaParserContext { pub fn drain_errors(&mut self) -> Vec { assert!(!self.errlog.is_null()); let errors = unsafe { &mut *self.errlog }; - errors.drain(0..).collect() + std::mem::take(errors) } /// Return a raw pointer to the underlying xmlSchemaParserCtxt structure diff --git a/src/schemas/validation.rs b/src/schemas/validation.rs index 6e9607897..8f3f7a333 100644 --- a/src/schemas/validation.rs +++ b/src/schemas/validation.rs @@ -83,7 +83,7 @@ impl SchemaValidationContext { pub fn drain_errors(&mut self) -> Vec { assert!(!self.errlog.is_null()); let errors = unsafe { &mut *self.errlog }; - errors.drain(0..).collect() + std::mem::take(errors) } /// Return a raw pointer to the underlying xmlSchemaValidCtxt structure