Fix all clippy warnings across workspace
collapsible_if, let-chains, derivable_impls, clone_on_copy, useless_vec, approx_constant, io_other_error, single_match, collapsible_match, unnecessary_map_or, manual_is_multiple_of, result_large_err, too_many_arguments, upper_case_acronyms Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -224,10 +224,10 @@ impl CallbackState {
|
||||
|
||||
impl Drop for CallbackState {
|
||||
fn drop(&mut self) {
|
||||
if let Ok(mut relay_task) = self.relay_task.lock() {
|
||||
if let Some(task) = relay_task.take() {
|
||||
task.abort();
|
||||
}
|
||||
if let Ok(mut relay_task) = self.relay_task.lock()
|
||||
&& let Some(task) = relay_task.take()
|
||||
{
|
||||
task.abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,10 +192,10 @@ impl Drop for SessionHandle {
|
||||
fn drop(&mut self) {
|
||||
if Arc::strong_count(&self.inner) == 1 {
|
||||
self.inner.request_close_nonblocking();
|
||||
if let Ok(mut task) = self.inner.task.try_lock() {
|
||||
if let Some(task) = task.take() {
|
||||
task.abort();
|
||||
}
|
||||
if let Ok(mut task) = self.inner.task.try_lock()
|
||||
&& let Some(task) = task.take()
|
||||
{
|
||||
task.abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -304,10 +304,10 @@ impl Session {
|
||||
}
|
||||
Some(SessionCmd::Connect) => {
|
||||
self.desired_connected = true;
|
||||
if self.conn.is_none() {
|
||||
if let Err(err) = self.connect().await {
|
||||
self.emit_error(format!("connect failed: {err}"));
|
||||
}
|
||||
if self.conn.is_none()
|
||||
&& let Err(err) = self.connect().await
|
||||
{
|
||||
self.emit_error(format!("connect failed: {err}"));
|
||||
}
|
||||
true
|
||||
}
|
||||
@@ -500,7 +500,7 @@ async fn try_read(
|
||||
}
|
||||
|
||||
fn to_io_error(err: xserial_core::error::Error) -> std::io::Error {
|
||||
io::Error::new(io::ErrorKind::Other, err.to_string())
|
||||
io::Error::other(err.to_string())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user