You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6 lines
174 B
Rust
6 lines
174 B
Rust
4 years ago
|
/// Enquotes a string in a safe way
|
||
|
pub fn enquote<S: ToString>(value: S) -> String {
|
||
|
let value = value.to_string();
|
||
|
format!("\"{}\"", value.replace("\"", "\\\""))
|
||
|
}
|