diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fb0e6a78..7895e006 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,9 +16,9 @@ jobs: - uses: actions/checkout@v4 - name: Install Rust - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@1.84.1 with: - components: clippy + components: clippy, rustfmt - name: Run Clippy run: cargo clippy -- -D warnings --allow unused_variables diff --git a/ra-rpc/src/rocket_helper.rs b/ra-rpc/src/rocket_helper.rs index 223d6045..65a09bb0 100644 --- a/ra-rpc/src/rocket_helper.rs +++ b/ra-rpc/src/rocket_helper.rs @@ -227,7 +227,7 @@ impl<'r> FromRequest<'r> for RpcRequest<'r> { } } -impl<'s, 'r, S> PrpcHandler<'s, 'r, S> { +impl PrpcHandler<'_, '_, S> { pub async fn handle>(self) -> Custom> { let json = self.request.json; let result = handle_prpc_impl::(self).await; diff --git a/supervisor/src/supervisor.rs b/supervisor/src/supervisor.rs index 1507cbe7..f4ac6387 100644 --- a/supervisor/src/supervisor.rs +++ b/supervisor/src/supervisor.rs @@ -57,7 +57,7 @@ impl Supervisor { } if self .info(&id) - .map_or(false, |info| info.state.status.is_running()) + .is_some_and(|info| info.state.status.is_running()) { bail!("Process is already running"); } diff --git a/teepod/src/app.rs b/teepod/src/app.rs index 9f315ffd..0179c7c2 100644 --- a/teepod/src/app.rs +++ b/teepod/src/app.rs @@ -126,7 +126,7 @@ impl App { .supervisor .info(id) .await? - .map_or(false, |info| info.state.status.is_running()); + .is_some_and(|info| info.state.status.is_running()); self.set_started(id, true)?; let vm_config = { let mut state = self.lock(); @@ -170,7 +170,7 @@ impl App { pub async fn remove_vm(&self, id: &str) -> Result<()> { let info = self.supervisor.info(id).await?; - let is_running = info.as_ref().map_or(false, |i| i.state.status.is_running()); + let is_running = info.as_ref().is_some_and(|i| i.state.status.is_running()); if is_running { bail!("VM is running, stop it first"); } diff --git a/tproxy/src/proxy/io_bridge.rs b/tproxy/src/proxy/io_bridge.rs index 3b39d926..68229688 100644 --- a/tproxy/src/proxy/io_bridge.rs +++ b/tproxy/src/proxy/io_bridge.rs @@ -23,7 +23,7 @@ struct OneDirection<'a, R, W> { next_step: NextStep, } -impl<'a, R, W> OneDirection<'a, R, W> +impl OneDirection<'_, R, W> where R: AsyncRead + Unpin, W: AsyncWrite + Unpin,