mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +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:
@@ -121,7 +121,7 @@ pub unsafe fn dc_e2ee_encrypt(
|
||||
let peerstate = Peerstate::from_addr(
|
||||
context,
|
||||
&context.sql.clone().read().unwrap(),
|
||||
to_str(recipient_addr),
|
||||
as_str(recipient_addr),
|
||||
);
|
||||
if peerstate.is_some()
|
||||
&& (peerstate.as_ref().unwrap().prefer_encrypt
|
||||
@@ -613,7 +613,7 @@ pub unsafe fn dc_e2ee_decrypt(
|
||||
let autocryptheader = Aheader::from_imffields(from, imffields);
|
||||
if message_time > 0 && !from.is_null() {
|
||||
peerstate =
|
||||
Peerstate::from_addr(context, &context.sql.clone().read().unwrap(), to_str(from));
|
||||
Peerstate::from_addr(context, &context.sql.clone().read().unwrap(), as_str(from));
|
||||
|
||||
if let Some(ref mut peerstate) = peerstate {
|
||||
if let Some(ref header) = autocryptheader {
|
||||
@@ -648,7 +648,7 @@ pub unsafe fn dc_e2ee_decrypt(
|
||||
peerstate = Peerstate::from_addr(
|
||||
&context,
|
||||
&context.sql.clone().read().unwrap(),
|
||||
to_str(from),
|
||||
as_str(from),
|
||||
);
|
||||
}
|
||||
if let Some(ref peerstate) = peerstate {
|
||||
|
||||
Reference in New Issue
Block a user