Skip to content

Commit

Permalink
Merge pull request #106 from Dstack-TEE/fix-clippy
Browse files Browse the repository at this point in the history
Fix cargo clippy errors
  • Loading branch information
kvinwang authored Feb 5, 2025
2 parents e85e60b + a90d229 commit d30c506
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ra-rpc/src/rocket_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ impl<'r> FromRequest<'r> for RpcRequest<'r> {
}
}

impl<'s, 'r, S> PrpcHandler<'s, 'r, S> {
impl<S> PrpcHandler<'_, '_, S> {
pub async fn handle<Call: RpcCall<S>>(self) -> Custom<Vec<u8>> {
let json = self.request.json;
let result = handle_prpc_impl::<S, Call>(self).await;
Expand Down
2 changes: 1 addition & 1 deletion supervisor/src/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
4 changes: 2 additions & 2 deletions teepod/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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");
}
Expand Down
2 changes: 1 addition & 1 deletion tproxy/src/proxy/io_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct OneDirection<'a, R, W> {
next_step: NextStep,
}

impl<'a, R, W> OneDirection<'a, R, W>
impl<R, W> OneDirection<'_, R, W>
where
R: AsyncRead + Unpin,
W: AsyncWrite + Unpin,
Expand Down

0 comments on commit d30c506

Please sign in to comment.