mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 12:56:30 +03:00
cargo fmt
This commit is contained in:
@@ -16,9 +16,12 @@ pub unsafe fn charconv(
|
||||
) -> libc::c_int {
|
||||
assert!(!fromcode.is_null(), "invalid fromcode");
|
||||
assert!(!s.is_null(), "invalid input string");
|
||||
if let Some(encoding) =
|
||||
charset::Charset::for_label(CStr::from_ptr(fromcode).to_str().unwrap_or_default().as_bytes())
|
||||
{
|
||||
if let Some(encoding) = charset::Charset::for_label(
|
||||
CStr::from_ptr(fromcode)
|
||||
.to_str()
|
||||
.unwrap_or_default()
|
||||
.as_bytes(),
|
||||
) {
|
||||
let data = std::slice::from_raw_parts(s as *const u8, strlen(s));
|
||||
|
||||
let (res, _, _) = encoding.decode(data);
|
||||
|
||||
Reference in New Issue
Block a user