refactor: use bytes instead of string

Some string handling functions deal with `Vec<u8>` or `&[u8]`, which
have been referred to as `string` or `str` in the function names. This
is confusing, since they don't deal with Rust's `String` type. Use
`bytes` in the function names instead to reduce confusion.

Closes #11969
This commit is contained in:
Daniel Rainer
2025-10-18 18:28:27 +02:00
committed by Johannes Altmanninger
parent 1fe6b28877
commit 61ee695e56
37 changed files with 191 additions and 186 deletions

View File

@@ -1,6 +1,6 @@
use crate::{
FLOG, FLOGF,
common::{str2wcstring, wcs2osstring, wcs2zstring},
common::{bytes2wcstring, wcs2osstring, wcs2zstring},
fds::wopen_cloexec,
path::{DirRemoteness, path_remoteness},
wchar::prelude::*,
@@ -64,7 +64,7 @@ pub fn create_temporary_file(name_template: &wstr) -> std::io::Result<(File, WSt
},
}
};
Ok((fd, str2wcstring(c_string_template.to_bytes())))
Ok((fd, bytes2wcstring(c_string_template.to_bytes())))
}
/// Use this struct for all accesses to file which need mutual exclusion.