mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 06:16:30 +03:00
Remove to_cstring() naming convention ambiguity
Add a trait for str.strdup() to replace to_cstring() which avoid the signature ambiguity with .to_string(). Also instruduce CString::yolo() as a shortcut to CString::new().unwrap() and use it whenever the variable does can be deallocated by going out of scope. This is less error prone. Use some Path.to_c_string() functions where possible.
This commit is contained in:
committed by
Floris Bruynooghe
parent
e7428887d0
commit
b6b0849bce
@@ -481,7 +481,7 @@ unsafe fn handle_cmd(line: &str, ctx: Arc<RwLock<Context>>) -> Result<ExitResult
|
||||
let arg1_c = if arg1.is_empty() {
|
||||
std::ptr::null()
|
||||
} else {
|
||||
to_cstring(arg1)
|
||||
arg1.strdup()
|
||||
};
|
||||
|
||||
match arg0 {
|
||||
|
||||
Reference in New Issue
Block a user