mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
fix clippy warnings
This commit is contained in:
@@ -920,7 +920,7 @@ pub fn make_module(vm: &VirtualMachine, module: PyObjectRef) {
|
||||
|
||||
crate::protocol::VecBuffer::make_class(&vm.ctx);
|
||||
|
||||
let _ = builtins::extend_module(vm, &module);
|
||||
builtins::extend_module(vm, &module);
|
||||
|
||||
let debug_mode: bool = vm.state.settings.optimize == 0;
|
||||
extend_module!(vm, module, {
|
||||
|
||||
@@ -1280,7 +1280,7 @@ mod _io {
|
||||
}
|
||||
}
|
||||
if self.writable() {
|
||||
let _ = self.flush_rewind(vm)?;
|
||||
self.flush_rewind(vm)?;
|
||||
}
|
||||
self.reset_read();
|
||||
self.pos = 0;
|
||||
|
||||
@@ -316,7 +316,8 @@ mod decl {
|
||||
fn repr(&self, vm: &VirtualMachine) -> PyResult<String> {
|
||||
let mut fmt = format!("{}", &self.object.repr(vm)?);
|
||||
if let Some(ref times) = self.times {
|
||||
fmt.push_str(&format!(", {}", times.read()));
|
||||
fmt.push_str(", ");
|
||||
fmt.push_str(×.read().to_string());
|
||||
}
|
||||
Ok(format!("repeat({})", fmt))
|
||||
}
|
||||
|
||||
@@ -1763,7 +1763,7 @@ pub(crate) struct SupportFunc {
|
||||
follow_symlinks: Option<bool>,
|
||||
}
|
||||
|
||||
impl<'a> SupportFunc {
|
||||
impl SupportFunc {
|
||||
pub(crate) fn new(
|
||||
name: &'static str,
|
||||
fd: Option<bool>,
|
||||
|
||||
@@ -516,8 +516,7 @@ pub mod module {
|
||||
|
||||
#[pyfunction]
|
||||
fn sched_yield(vm: &VirtualMachine) -> PyResult<()> {
|
||||
let _ = nix::sched::sched_yield().map_err(|e| e.to_pyexception(vm))?;
|
||||
Ok(())
|
||||
nix::sched::sched_yield().map_err(|e| e.to_pyexception(vm))
|
||||
}
|
||||
|
||||
#[pyattr]
|
||||
|
||||
Reference in New Issue
Block a user