mirror of
https://github.com/chatmail/core.git
synced 2026-05-17 05:46:30 +03:00
Fix clippy errors
This commit is contained in:
committed by
holger krekel
parent
35542189d8
commit
60b3550952
@@ -19,10 +19,10 @@ fn main() {
|
|||||||
include_str!("deltachat.pc.in"),
|
include_str!("deltachat.pc.in"),
|
||||||
name = "deltachat",
|
name = "deltachat",
|
||||||
description = env::var("CARGO_PKG_DESCRIPTION").unwrap(),
|
description = env::var("CARGO_PKG_DESCRIPTION").unwrap(),
|
||||||
url = env::var("CARGO_PKG_HOMEPAGE").unwrap_or("".to_string()),
|
url = env::var("CARGO_PKG_HOMEPAGE").unwrap_or_else(|_| "".to_string()),
|
||||||
version = env::var("CARGO_PKG_VERSION").unwrap(),
|
version = env::var("CARGO_PKG_VERSION").unwrap(),
|
||||||
libs_priv = libs_priv,
|
libs_priv = libs_priv,
|
||||||
prefix = env::var("PREFIX").unwrap_or("/usr/local".to_string()),
|
prefix = env::var("PREFIX").unwrap_or_else(|_| "/usr/local".to_string()),
|
||||||
);
|
);
|
||||||
|
|
||||||
fs::create_dir_all(target_path.join("pkgconfig")).unwrap();
|
fs::create_dir_all(target_path.join("pkgconfig")).unwrap();
|
||||||
|
|||||||
@@ -487,7 +487,7 @@ pub unsafe extern "C" fn dc_get_next_event(events: *mut dc_event_emitter_t) -> *
|
|||||||
events
|
events
|
||||||
.recv_sync()
|
.recv_sync()
|
||||||
.map(|ev| Box::into_raw(Box::new(ev)))
|
.map(|ev| Box::into_raw(Box::new(ev)))
|
||||||
.unwrap_or_else(|| ptr::null_mut())
|
.unwrap_or_else(ptr::null_mut)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|||||||
@@ -105,8 +105,9 @@ impl<T: AsRef<std::ffi::OsStr>> OsStrExt for T {
|
|||||||
#[cfg(not(target_os = "windows"))]
|
#[cfg(not(target_os = "windows"))]
|
||||||
fn to_c_string(&self) -> Result<CString, CStringError> {
|
fn to_c_string(&self) -> Result<CString, CStringError> {
|
||||||
use std::os::unix::ffi::OsStrExt;
|
use std::os::unix::ffi::OsStrExt;
|
||||||
CString::new(self.as_ref().as_bytes()).map_err(|err| match err {
|
CString::new(self.as_ref().as_bytes()).map_err(|err| {
|
||||||
std::ffi::NulError { .. } => CStringError::InteriorNullByte,
|
let std::ffi::NulError { .. } = err;
|
||||||
|
CStringError::InteriorNullByte
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,8 +123,9 @@ fn os_str_to_c_string_unicode(
|
|||||||
os_str: &dyn AsRef<std::ffi::OsStr>,
|
os_str: &dyn AsRef<std::ffi::OsStr>,
|
||||||
) -> Result<CString, CStringError> {
|
) -> Result<CString, CStringError> {
|
||||||
match os_str.as_ref().to_str() {
|
match os_str.as_ref().to_str() {
|
||||||
Some(val) => CString::new(val.as_bytes()).map_err(|err| match err {
|
Some(val) => CString::new(val.as_bytes()).map_err(|err| {
|
||||||
std::ffi::NulError { .. } => CStringError::InteriorNullByte,
|
let std::ffi::NulError { .. } = err;
|
||||||
|
CStringError::InteriorNullByte
|
||||||
}),
|
}),
|
||||||
None => Err(CStringError::NotUnicode),
|
None => Err(CStringError::NotUnicode),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user