From c0cb138c395eed70cfd02b9f927673b99c6ed9f0 Mon Sep 17 00:00:00 2001 From: Jan Starke Date: Fri, 7 Jul 2023 17:05:00 +0200 Subject: [PATCH] better escapting of string literals --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/vk.rs | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eec9025..bd5b88d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -485,7 +485,7 @@ dependencies = [ [[package]] name = "nt_hive2" -version = "3.1.0" +version = "3.1.1" dependencies = [ "anyhow", "backtrace-on-stack-overflow", diff --git a/Cargo.toml b/Cargo.toml index a6a219e..6dbc814 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nt_hive2" -version = "3.1.0" +version = "3.1.1" edition = "2021" authors = ["Jan Starke ", "Muteb Alqahtani "] license = "GPL-3.0" diff --git a/src/vk.rs b/src/vk.rs index 0776c19..70829e3 100644 --- a/src/vk.rs +++ b/src/vk.rs @@ -273,18 +273,18 @@ impl Display for RegistryValue { match self { RegistryValue::RegUnknown => write!(f, "Unknown"), RegistryValue::RegNone => write!(f, "None"), - RegistryValue::RegSZ(val) => write!(f, "\"{}\"", val), - RegistryValue::RegExpandSZ(val) => write!(f, "\"{}\"", val), + RegistryValue::RegSZ(val) => write!(f, "{val:?}"), + RegistryValue::RegExpandSZ(val) => write!(f, "{val:?}"), RegistryValue::RegBinary(val) => { write!(f, "{:?}", if val.len() > 16 { &val[..16] } else { val }) } RegistryValue::RegDWord(val) => write!(f, "0x{:08x}", val), RegistryValue::RegDWordBigEndian(val) => write!(f, "0x{:08x}", val), - RegistryValue::RegLink(val) => write!(f, "\"{}\"", val), + RegistryValue::RegLink(val) => write!(f, "{val:?}"), RegistryValue::RegMultiSZ(val) => write!(f, "{:?}", val), - RegistryValue::RegResourceList(val) => write!(f, "\"{}\"", val), - RegistryValue::RegFullResourceDescriptor(val) => write!(f, "\"{}\"", val), - RegistryValue::RegResourceRequirementsList(val) => write!(f, "\"{}\"", val), + RegistryValue::RegResourceList(val) => write!(f, "{val:?}"), + RegistryValue::RegFullResourceDescriptor(val) => write!(f, "{val:?}"), + RegistryValue::RegResourceRequirementsList(val) => write!(f, "{val:?}"), RegistryValue::RegQWord(val) => write!(f, "0x{:016x}", val), RegistryValue::RegFileTime => todo!(), }