mirror of
https://github.com/chatmail/core.git
synced 2026-05-16 21: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:
@@ -779,7 +779,7 @@ pub unsafe fn dc_get_contact_encrinfo(
|
||||
let peerstate = Peerstate::from_addr(
|
||||
context,
|
||||
&context.sql.clone().read().unwrap(),
|
||||
to_str((*contact).addr),
|
||||
as_str((*contact).addr),
|
||||
);
|
||||
dc_loginparam_read(
|
||||
context,
|
||||
@@ -831,7 +831,7 @@ pub unsafe fn dc_get_contact_encrinfo(
|
||||
.map(|k| k.formatted_fingerprint_c())
|
||||
.unwrap_or(std::ptr::null_mut());
|
||||
if peerstate.addr.is_some()
|
||||
&& to_str((*loginparam).addr) < peerstate.addr.as_ref().unwrap().as_str()
|
||||
&& as_str((*loginparam).addr) < peerstate.addr.as_ref().unwrap().as_str()
|
||||
{
|
||||
cat_fingerprint(
|
||||
&mut ret,
|
||||
@@ -1121,7 +1121,7 @@ pub unsafe fn dc_contact_is_verified_ex<'a>(
|
||||
let peerstate = Peerstate::from_addr(
|
||||
(*contact).context,
|
||||
&(*contact).context.sql.clone().read().unwrap(),
|
||||
to_str((*contact).addr),
|
||||
as_str((*contact).addr),
|
||||
);
|
||||
|
||||
let res = if let Some(ps) = peerstate {
|
||||
|
||||
Reference in New Issue
Block a user