Merge pull request #4334 from fanninpm/clippy-1.66

This commit is contained in:
fanninpm
2022-12-17 13:42:18 -05:00
committed by GitHub
3 changed files with 6 additions and 5 deletions

View File

@@ -67,7 +67,7 @@ impl ItemNursery {
if !inserted {
return Err(syn::Error::new(
item.attr_name.span(),
&format!("Duplicated #[py*] attribute found for {:?}", &item.py_names),
format!("Duplicated #[py*] attribute found for {:?}", &item.py_names),
));
}
}

View File

@@ -1109,7 +1109,7 @@ pub(super) mod _os {
// TODO: replicate CPython's win32_xstat
let [] = dir_fd.0;
let meta = match file {
PathOrFd::Path(path) => super::fs_metadata(&path, follow_symlinks.0)?,
PathOrFd::Path(path) => super::fs_metadata(path, follow_symlinks.0)?,
PathOrFd::Fd(fno) => {
use std::os::windows::io::FromRawHandle;
let handle = Fd(fno).to_raw_handle()?;
@@ -1521,9 +1521,10 @@ pub(super) mod _os {
};
let tick_for_second = unsafe { libc::sysconf(libc::_SC_CLK_TCK) } as f64;
let c = unsafe { libc::times(&mut t as *mut _) } as i64;
let c = unsafe { libc::times(&mut t as *mut _) };
if c == -1 {
// XXX: The signedness of `clock_t` varies from platform to platform.
if c == (-1i8) as libc::clock_t {
return Err(vm.new_os_error("Fail to get times".to_string()));
}

View File

@@ -258,7 +258,7 @@ mod winreg {
value: PyStrRef,
vm: &VirtualMachine,
) -> PyResult<()> {
if typ != REG_SZ as u32 {
if typ != REG_SZ {
return Err(vm.new_type_error("type must be winreg.REG_SZ".to_owned()));
}
let subkey = subkey.as_ref().map_or("", |s| s.as_str());