diff --git a/src/parser.rs b/src/parser.rs index 87c15ab74c..2d342ab473 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -196,7 +196,7 @@ fn try_usize_to_i32(value: usize) -> Result { } } -#[derive(PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq)] /// Enum for the parse formats supported by libxml2 pub enum ParseFormat { /// Strict parsing for XML diff --git a/src/schemas/parser.rs b/src/schemas/parser.rs index 5f57be2196..7c84a4a734 100644 --- a/src/schemas/parser.rs +++ b/src/schemas/parser.rs @@ -73,7 +73,7 @@ impl SchemaParserContext { /// Private Interface impl SchemaParserContext { fn from_raw(parser: *mut bindings::_xmlSchemaParserCtxt) -> Self { - let errors: Box> = Box::new(Vec::new()); + let errors: Box> = Box::default(); unsafe { let reference: *mut Vec = std::mem::transmute(errors); diff --git a/src/schemas/validation.rs b/src/schemas/validation.rs index 458798d7fb..6e96078979 100644 --- a/src/schemas/validation.rs +++ b/src/schemas/validation.rs @@ -95,7 +95,7 @@ impl SchemaValidationContext { /// Private Interface impl SchemaValidationContext { fn from_raw(ctx: *mut bindings::_xmlSchemaValidCtxt, schema: Schema) -> Self { - let errors: Box> = Box::new(Vec::new()); + let errors: Box> = Box::default(); unsafe { let reference: *mut Vec = std::mem::transmute(errors);