mirror of
https://github.com/chatmail/core.git
synced 2026-04-21 15:36:30 +03:00
Rename to_str() -> as_str() to match stdlib naming convention
The function does a cast and does not create a new objects. The stdlib convention is to use to_*() for functions which return new objects and as_*() for functions which keep referring to the same data but using a different type. Follow that convention.
This commit is contained in:
@@ -164,7 +164,7 @@ pub unsafe fn dc_param_get_int(
|
||||
if str.is_null() {
|
||||
return def;
|
||||
}
|
||||
let ret: int32_t = to_str(str).parse().unwrap_or_default();
|
||||
let ret: int32_t = as_str(str).parse().unwrap_or_default();
|
||||
free(str as *mut libc::c_void);
|
||||
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user