Write via XML

This commit is contained in:
Jaby
2022-11-08 22:13:06 +01:00
committed by Jaby
parent 4706e82459
commit 75760bb764
4 changed files with 15 additions and 49 deletions

View File

@@ -24,7 +24,7 @@ impl CDStringValidator for AStringValidator {
let chr = *chr as char;
if !matches!(chr, '0'..='9' | 'A'..='Z' | ' ' | '!' | '"' | '%' | '&' | '\'' | '(' | ')' | '*' | '+' | ',' | '-' | '.' | '/' | ':' | ';' | '<' | '=' | '>' | '?' | '_') {
return Err(Error::GenericError(format!("{} not a valid a-character", chr)));
return Err(Error::GenericError(format!("Error parsing \"{}\": '{}' not a valid a-character", String::from_utf8_lossy(value), chr)));
}
}
Ok(())
@@ -37,7 +37,7 @@ impl CDStringValidator for DStringValidator {
let chr = *chr as char;
if !matches!(chr, '\x00' | '\x01' | '0'..='9' | 'A'..='Z' | '_') {
return Err(Error::GenericError(format!("{} not a valid d-character", chr)));
return Err(Error::GenericError(format!("Error parsing \"{}\": '{}' not a valid d-character", String::from_utf8_lossy(value), chr)));
}
}
Ok(())