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:
Floris Bruynooghe
2019-06-07 22:08:49 +02:00
parent 18c0d9f83b
commit 855c7844b5
19 changed files with 84 additions and 84 deletions

View File

@@ -486,13 +486,13 @@ unsafe fn dc_job_do_DC_JOB_MOVE_MSG(context: &Context, job: &mut dc_job_t) {
);
if !dest_folder.is_null() {
let server_folder = to_str((*msg).server_folder);
let server_folder = as_str((*msg).server_folder);
match inbox.mv(
context,
server_folder,
(*msg).server_uid,
to_str(dest_folder),
as_str(dest_folder),
&mut dest_uid,
) as libc::c_uint
{
@@ -593,7 +593,7 @@ unsafe fn dc_job_do_DC_JOB_MARKSEEN_MDN_ON_IMAP(context: &Context, job: &mut dc_
0 as *const libc::c_char,
);
if !dest_folder.is_null() {
let dest_folder = to_str(dest_folder);
let dest_folder = as_str(dest_folder);
if 1 == inbox.mv(context, folder, uid, dest_folder, &mut dest_uid)
as libc::c_uint
{