From cb09ab865c84dd53f2915c7bb5179dd23a7aa624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Tue, 25 Jun 2024 15:51:40 +0200 Subject: [PATCH] parsers: use built-in string quoting instead of manual quoting There is at least one branch of the FromStr implementation which passes user input right into the error struct, so we cannot assume that `'` is not part of that value. --- parsers/src/data_forms/validate.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parsers/src/data_forms/validate.rs b/parsers/src/data_forms/validate.rs index 58e16318..c4f5db02 100644 --- a/parsers/src/data_forms/validate.rs +++ b/parsers/src/data_forms/validate.rs @@ -108,13 +108,13 @@ impl Display for DatatypeError { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self { DatatypeError::MissingPrefix { input } => { - write!(f, "Missing prefix in validation datatype '{input}'.") + write!(f, "Missing prefix in validation datatype {input:?}.") } DatatypeError::InvalidType { input } => { - write!(f, "Invalid validation datatype '{input}'.") + write!(f, "Invalid validation datatype {input:?}.") } DatatypeError::UnknownType { input } => { - write!(f, "Unknown validation datatype '{input}'.") + write!(f, "Unknown validation datatype {input:?}.") } } }