rust: Pass through clippy

Some tweaks as suggested by rust-clippy.

Closes: #1390
Approved by: cgwalters
This commit is contained in:
Jonathan Lebon 2018-06-05 15:51:05 -04:00 committed by Atomic Bot
parent 702daa2335
commit 60d49c3413
2 changed files with 5 additions and 5 deletions

View File

@ -41,9 +41,9 @@ where
E: std::error::Error, E: std::error::Error,
{ {
fn to_glib_convention(self: Result<T, E>, error: *mut *mut glib_sys::GError) -> libc::c_int { fn to_glib_convention(self: Result<T, E>, error: *mut *mut glib_sys::GError) -> libc::c_int {
match &self { match self {
&Ok(_) => 1, Ok(_) => 1,
&Err(ref e) => { Err(ref e) => {
if !error.is_null() { if !error.is_null() {
unsafe { unsafe {
assert!((*error).is_null()); assert!((*error).is_null());

View File

@ -80,14 +80,14 @@ fn treefile_read_impl(filename: &Path, output: fs::File) -> io::Result<()> {
Ok(()) Ok(())
} }
fn whitespace_split_packages(pkgs: &Vec<String>) -> Vec<String> { fn whitespace_split_packages(pkgs: &[String]) -> Vec<String> {
let mut ret = Vec::with_capacity(pkgs.len()); let mut ret = Vec::with_capacity(pkgs.len());
for pkg in pkgs { for pkg in pkgs {
for pkg_item in pkg.split_whitespace() { for pkg_item in pkg.split_whitespace() {
ret.push(pkg_item.into()); ret.push(pkg_item.into());
} }
} }
return ret; ret
} }
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]