diff --git a/Cargo.toml b/Cargo.toml index ce336bc..a36c9bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rustwide" version = "0.21.0" -edition = "2018" +edition = "2024" build = "build.rs" documentation = "https://docs.rs/rustwide" diff --git a/examples/docs-builder.rs b/examples/docs-builder.rs index 2fc749f..c928829 100644 --- a/examples/docs-builder.rs +++ b/examples/docs-builder.rs @@ -1,5 +1,5 @@ use rustwide::cmd::SandboxImage; -use rustwide::{cmd::SandboxBuilder, Crate, Toolchain, WorkspaceBuilder}; +use rustwide::{Crate, Toolchain, WorkspaceBuilder, cmd::SandboxBuilder}; use std::error::Error; use std::path::Path; diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index df93a9e..7367fca 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -26,7 +26,7 @@ use tokio::{ runtime::Runtime, time, }; -use tokio_stream::{wrappers::LinesStream, StreamExt}; +use tokio_stream::{StreamExt, wrappers::LinesStream}; lazy_static::lazy_static! { // TODO: Migrate to asynchronous code and remove runtime diff --git a/src/cmd/sandbox.rs b/src/cmd/sandbox.rs index 3a3954b..6f4d3c6 100644 --- a/src/cmd/sandbox.rs +++ b/src/cmd/sandbox.rs @@ -1,5 +1,5 @@ -use crate::cmd::{Command, CommandError, ProcessLinesActions, ProcessOutput}; use crate::Workspace; +use crate::cmd::{Command, CommandError, ProcessLinesActions, ProcessOutput}; use log::{error, info}; use serde::Deserialize; use std::error::Error; diff --git a/src/crates/git.rs b/src/crates/git.rs index d7704ee..92fe7be 100644 --- a/src/crates/git.rs +++ b/src/crates/git.rs @@ -1,7 +1,7 @@ use super::CrateTrait; +use crate::Workspace; use crate::cmd::{Command, ProcessLinesActions}; use crate::prepare::PrepareError; -use crate::Workspace; use anyhow::Context as _; use log::{info, warn}; use std::path::{Path, PathBuf}; @@ -23,10 +23,10 @@ impl GitRepo { match res { Ok(out) => { - if let Some(shaline) = out.stdout_lines().first() { - if !shaline.is_empty() { - return Some(shaline.to_string()); - } + if let Some(shaline) = out.stdout_lines().first() + && !shaline.is_empty() + { + return Some(shaline.to_string()); } warn!("bad output from `git rev-parse HEAD`"); } diff --git a/src/inside_docker.rs b/src/inside_docker.rs index ec3cb4c..fb0e6a1 100644 --- a/src/inside_docker.rs +++ b/src/inside_docker.rs @@ -1,6 +1,6 @@ use crate::cmd::Command; use crate::workspace::Workspace; -use base64::{engine::general_purpose::STANDARD as b64, Engine}; +use base64::{Engine, engine::general_purpose::STANDARD as b64}; use getrandom::getrandom; use log::info; @@ -69,11 +69,11 @@ pub(crate) fn probe_container_id(workspace: &Workspace) -> anyhow::Result