fix: use rust raw string literal syntax for quote mark escape

This commit is contained in:
2026-06-26 16:04:15 +08:00
parent e3a1195c04
commit 4fcdf902f7
4 changed files with 18 additions and 18 deletions

View File

@@ -35,7 +35,7 @@ pub enum Error {
#[error("given extension name {0} is not presented in application")] #[error("given extension name {0} is not presented in application")]
BadExtName(String), BadExtName(String),
/// Find star (*) extension name with other extension names when converting extension name to index /// Find star (*) extension name with other extension names when converting extension name to index
#[error("wildcard extension name \"*\" is not allowed to be used with other extension names")] #[error(r#"wildcard extension name "*" is not allowed to be used with other extension names"#)]
ExclusiveStarExtName, ExclusiveStarExtName,
} }

View File

@@ -421,7 +421,7 @@ impl Program {
for program_key in &mut self.ext_keys { for program_key in &mut self.ext_keys {
let progid_key = &mut program_key.progid_key; let progid_key = &mut program_key.progid_key;
debug_println!( debug_println!(
"Adding ProgId \"{0}\" subkey...", r#"Adding ProgId "{0}" subkey..."#,
progid_key.inner().to_string() progid_key.inner().to_string()
); );
@@ -464,7 +464,7 @@ impl Program {
for program_key in &mut self.ext_keys { for program_key in &mut self.ext_keys {
let progid_key = &mut program_key.progid_key; let progid_key = &mut program_key.progid_key;
debug_println!( debug_println!(
"Deleting ProgId \"{0}\" subkey...", r#"Deleting ProgId "{0}" subkey..."#,
progid_key.inner().to_string() progid_key.inner().to_string()
); );
@@ -512,7 +512,7 @@ impl Program {
for program_key in &self.ext_keys { for program_key in &self.ext_keys {
let progid_key = &program_key.progid_key; let progid_key = &program_key.progid_key;
debug_println!( debug_println!(
"Checking ProgId \"{0}\" subkey...", r#"Checking ProgId "{0}" subkey..."#,
progid_key.inner().to_string() progid_key.inner().to_string()
); );
@@ -532,7 +532,7 @@ impl Program {
let ext_key = &mut program_key.ext_key; let ext_key = &mut program_key.ext_key;
let progid_key = &program_key.progid_key; let progid_key = &program_key.progid_key;
debug_println!( debug_println!(
"Linking ProgId \"{0}\" to extension \"{1}\" subkey...", r#"Linking ProgId "{0}" to extension "{1}" subkey..."#,
progid_key.inner().to_string(), progid_key.inner().to_string(),
ext_key.inner().to_string() ext_key.inner().to_string()
); );
@@ -556,7 +556,7 @@ impl Program {
Some(program_key) => { Some(program_key) => {
let ext_key = &mut program_key.ext_key; let ext_key = &mut program_key.ext_key;
debug_println!( debug_println!(
"Unlinking for extension \"{0}\" subkey...", r#"Unlinking for extension "{0}" subkey..."#,
ext_key.inner().to_string() ext_key.inner().to_string()
); );
@@ -586,7 +586,7 @@ impl Program {
Some(program_key) => { Some(program_key) => {
let ext_key = &program_key.ext_key; let ext_key = &program_key.ext_key;
debug_println!( debug_println!(
"Querying for extension \"{0}\"subkey...", r#"Querying for extension "{0}"subkey..."#,
ext_key.inner().to_string() ext_key.inner().to_string()
); );

View File

@@ -15,7 +15,7 @@ use windows_sys::Win32::UI::WindowsAndMessaging::HICON;
/// The error occurs when constructing Ext with bad body. /// The error occurs when constructing Ext with bad body.
#[derive(Debug, TeError)] #[derive(Debug, TeError)]
#[error("given file extension body \"{inner}\" is invalid")] #[error(r#"given file extension body "{inner}" is invalid"#)]
pub struct BadExtBodyError { pub struct BadExtBodyError {
/// The clone of string which is not a valid file extension body. /// The clone of string which is not a valid file extension body.
inner: String, inner: String,
@@ -83,7 +83,7 @@ impl Ext {
/// The error occurs when try parsing string into FileExt. /// The error occurs when try parsing string into FileExt.
#[derive(Debug, TeError)] #[derive(Debug, TeError)]
#[error("given file extension name \"{inner}\" is invalid")] #[error(r#"given file extension name "{inner}" is invalid"#)]
pub struct ParseExtError { pub struct ParseExtError {
/// The clone of string which is not a valid file extension. /// The clone of string which is not a valid file extension.
inner: String, inner: String,
@@ -124,7 +124,7 @@ impl FromStr for Ext {
/// The error occurs when constructing ProgId. /// The error occurs when constructing ProgId.
#[derive(Debug, TeError)] #[derive(Debug, TeError)]
#[error("given ProgId part \"{inner}\" is invalid")] #[error(r#"given ProgId part "{inner}" is invalid"#)]
pub struct BadProgIdPartError { pub struct BadProgIdPartError {
/// The clone of string which is not a valid ProgId part. /// The clone of string which is not a valid ProgId part.
inner: String, inner: String,
@@ -208,7 +208,7 @@ impl ProgId {
/// The error occurs when parsing ProgId. /// The error occurs when parsing ProgId.
#[derive(Debug, TeError)] #[derive(Debug, TeError)]
#[error("given ProgId \"{inner}\" is invalid")] #[error(r#"given ProgId "{inner}" is invalid"#)]
pub struct ParseProgIdError { pub struct ParseProgIdError {
/// The clone of string which is not a valid ProgId. /// The clone of string which is not a valid ProgId.
inner: String, inner: String,
@@ -294,7 +294,7 @@ impl Clsid {
/// The error occurs when parsing CLSID. /// The error occurs when parsing CLSID.
#[derive(Debug, TeError)] #[derive(Debug, TeError)]
#[error("given string \"{inner}\" is invalid for CLSID")] #[error(r#"given string "{inner}" is invalid for CLSID"#)]
pub struct ParseClsidError { pub struct ParseClsidError {
/// The clone of string which is not a valid CLSID. /// The clone of string which is not a valid CLSID.
inner: String, inner: String,
@@ -331,7 +331,7 @@ impl Display for Clsid {
/// Error occurs when given string is not a valid Icon Reference String. /// Error occurs when given string is not a valid Icon Reference String.
#[derive(Debug, TeError)] #[derive(Debug, TeError)]
#[error("given string \"{inner}\" is not a valid Icon Reference String")] #[error(r#"given string "{inner}" is not a valid Icon Reference String"#)]
pub struct ParseIconRefStrError { pub struct ParseIconRefStrError {
/// The clone of string which is not a valid Icon Reference String /// The clone of string which is not a valid Icon Reference String
inner: String, inner: String,
@@ -442,7 +442,7 @@ impl FromStr for IconRefStr {
/// Error occurs when given string is not a valid String Reference String. /// Error occurs when given string is not a valid String Reference String.
#[derive(Debug, TeError)] #[derive(Debug, TeError)]
#[error("given string \"{inner}\" is not a valid String Reference String")] #[error(r#"given string "{inner}" is not a valid String Reference String"#)]
pub struct ParseStrRefStrError { pub struct ParseStrRefStrError {
/// The clone of string which is not a valid String Reference String /// The clone of string which is not a valid String Reference String
inner: String, inner: String,
@@ -1031,7 +1031,7 @@ impl Verb {
/// The error occurs when parsing Verb with bad verb name. /// The error occurs when parsing Verb with bad verb name.
#[derive(Debug, TeError)] #[derive(Debug, TeError)]
#[error("given verb \"{inner}\" is illegal")] #[error(r#"given verb "{inner}" is illegal"#)]
pub struct ParseVerbError { pub struct ParseVerbError {
inner: String, inner: String,
} }
@@ -1076,7 +1076,7 @@ impl FromStr for Verb {
/// The error occurs when constructing CmdLine with bad arguments. /// The error occurs when constructing CmdLine with bad arguments.
#[derive(Debug, TeError)] #[derive(Debug, TeError)]
#[error("given command line argument \"{inner}\" is invalid")] #[error(r#"given command line argument "{inner}" is invalid"#)]
pub struct BadCmdLineError { pub struct BadCmdLineError {
inner: String, inner: String,
} }
@@ -1162,7 +1162,7 @@ impl CmdLine {
/// The error occurs when parsing CmdLine with bad syntax. /// The error occurs when parsing CmdLine with bad syntax.
#[derive(Debug, TeError)] #[derive(Debug, TeError)]
#[error("given command line \"{inner}\" is invalid")] #[error(r#"given command line "{inner}" is invalid"#)]
pub struct ParseCmdLineError { pub struct ParseCmdLineError {
inner: String, inner: String,
} }

View File

@@ -10,7 +10,7 @@ pub fn check_sandbox() {
concat!( concat!(
"Non-sandbox environment detected. ", "Non-sandbox environment detected. ",
"Executing these tests in non-sandbox environment is VERY dangerous. ", "Executing these tests in non-sandbox environment is VERY dangerous. ",
"Please set \"SANDBOXIE\" environment variable to explicitly indicate you are running these tests in sandbox environment." r#"Please set "SANDBOXIE" environment variable to explicitly indicate you are running these tests in sandbox environment."#
) )
) )
} }