diff --git a/src/cli/add.rs b/src/cli/add.rs index 7c791f8..025d67c 100644 --- a/src/cli/add.rs +++ b/src/cli/add.rs @@ -17,12 +17,10 @@ use crate::prelude::*; -use crate::core::build_config::Config; -use crate::core::deps::register; +use crate::core::{build_config::Config, deps::register}; use crate::utils::fs::find_project_root; use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc}; -use toml::Value; -use toml::map::Map; +use toml::{Value, map::Map}; /// Parsed arguments for the `dcr add` command. /// diff --git a/src/cli/clean.rs b/src/cli/clean.rs index 0c0e8e7..bfb30b4 100644 --- a/src/cli/clean.rs +++ b/src/cli/clean.rs @@ -23,8 +23,7 @@ use crate::utils::build::{default_profile_flags, default_target_triple, parse_ve use crate::utils::fs::{check_dir, find_project_root, with_dir}; use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc}; use glob::glob; -use std::fs; -use std::path::Path; +use std::{fs, path::Path}; /// Entry point for the `dcr clean` command. /// diff --git a/src/cli/init.rs b/src/cli/init.rs index 1a7cb72..f83b721 100644 --- a/src/cli/init.rs +++ b/src/cli/init.rs @@ -22,8 +22,7 @@ use crate::core::build_config::{Config, validate_package_name}; use crate::core::vcs::VcsKind; use crate::utils::fs::check_dir; use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc}; -use std::fs; -use std::io::Write; +use std::{fs, io::Write}; /// Initializes the current working directory as a new DCR project. /// diff --git a/src/cli/new.rs b/src/cli/new.rs index e7ec5bb..d32a593 100644 --- a/src/cli/new.rs +++ b/src/cli/new.rs @@ -22,8 +22,7 @@ use crate::core::build_config::{Config, validate_package_name}; use crate::core::vcs::VcsKind; use crate::utils::fs::check_dir; use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc}; -use std::fs; -use std::io::Write; +use std::{fs, io::Write}; /// Executes the `dcr new` command to scaffold a new C/C++ project directory structure. /// diff --git a/src/cli/run.rs b/src/cli/run.rs index 9bc2b85..95fe6ea 100644 --- a/src/cli/run.rs +++ b/src/cli/run.rs @@ -22,11 +22,9 @@ use crate::cli::flags::parse_build_run_flags; use crate::core::build_config::Config; use crate::core::runner::run_binary; use crate::utils::build::{normalize_target_os, parse_version_info, substitute_vars}; -use crate::utils::fs::find_project_root; -use crate::utils::fs::with_dir; +use crate::utils::fs::{find_project_root, with_dir}; use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc}; -use std::path::Path; -use std::process::Command; +use std::{path::Path, process::Command}; /// Retrieves the run command from the config, preferring target-specific, /// then profile-specific, then the base `run.cmd`. diff --git a/src/core/build/builder/artifact.rs b/src/core/build/builder/artifact.rs index afedf3a..6da9f66 100644 --- a/src/core/build/builder/artifact.rs +++ b/src/core/build/builder/artifact.rs @@ -15,8 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::core::build::builder::BuildContext; -use crate::core::build::common; +use crate::core::build::{builder::BuildContext, common}; use crate::platform; use crate::utils::build::is_bare_metal_target; use std::path::{Path, PathBuf}; diff --git a/src/core/build/builder/cc_common.rs b/src/core/build/builder/cc_common.rs index 963e120..42c1221 100644 --- a/src/core/build/builder/cc_common.rs +++ b/src/core/build/builder/cc_common.rs @@ -15,9 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::core::build::builder::BuildContext; -use crate::core::build::builder::artifact; -use crate::core::build::common; +use crate::core::build::{builder::BuildContext, builder::artifact, common}; use crate::utils::build::{is_bare_metal_target, is_compile_only, is_flat_bin}; use std::fs; use std::path::{Path, PathBuf}; diff --git a/src/core/build/builder/msvc/mod.rs b/src/core/build/builder/msvc/mod.rs index b0d6dc4..ed4b2a9 100644 --- a/src/core/build/builder/msvc/mod.rs +++ b/src/core/build/builder/msvc/mod.rs @@ -20,15 +20,10 @@ /// This module provides the MSVC-specific build implementation for C and C++ /// projects, including object compilation and linking for executables, static /// libraries, shared libraries, and flat binaries. -use crate::core::build::builder::BuildContext; -use crate::core::build::builder::artifact; -use crate::core::build::common; +use crate::core::build::{builder::BuildContext, builder::artifact, common}; use crate::platform; use crate::utils::build::{is_compile_only, is_flat_bin}; -use std::fs; -use std::path::Path; -use std::process::Command; -use std::time::Instant; +use std::{fs, path::Path, process::Command, time::Instant}; /// Builds the project target using the MSVC compiler. pub fn build(ctx: &BuildContext) -> Result { diff --git a/src/core/build/cache.rs b/src/core/build/cache.rs index d1184db..ef37bd3 100644 --- a/src/core/build/cache.rs +++ b/src/core/build/cache.rs @@ -15,8 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::core::build::builder::BuildContext; -use crate::core::build::common; +use crate::core::build::{builder::BuildContext, common}; use sha2::{Digest, Sha256}; use std::fs; use std::path::{Path, PathBuf}; diff --git a/src/core/build/language/asm/common.rs b/src/core/build/language/asm/common.rs index 1a1cb97..81a3921 100644 --- a/src/core/build/language/asm/common.rs +++ b/src/core/build/language/asm/common.rs @@ -1,9 +1,6 @@ -use crate::core::build::builder::BuildContext; -use crate::core::build::builder::artifact; -use crate::core::build::common; +use crate::core::build::{builder::BuildContext, builder::artifact, common}; use crate::utils::build::{is_compile_only, is_flat_bin}; -use std::path::Path; -use std::time::Instant; +use std::{path::Path, time::Instant}; /// Keeps only assembler-relevant flags from a cflags list. /// diff --git a/src/core/build/language/asm/fasm/mod.rs b/src/core/build/language/asm/fasm/mod.rs index ff928ec..c4d3994 100644 --- a/src/core/build/language/asm/fasm/mod.rs +++ b/src/core/build/language/asm/fasm/mod.rs @@ -1,9 +1,6 @@ -use crate::core::build::builder::BuildContext; -use crate::core::build::common; use crate::core::build::language::asm::common as asm; -use std::fs; -use std::path::Path; -use std::process::Command; +use crate::core::build::{builder::BuildContext, common}; +use std::{fs, path::Path, process::Command}; /// Builds an assembly file using the FASM assembler. /// diff --git a/src/core/build/language/asm/gas/mod.rs b/src/core/build/language/asm/gas/mod.rs index 6aab0bb..0bae39c 100644 --- a/src/core/build/language/asm/gas/mod.rs +++ b/src/core/build/language/asm/gas/mod.rs @@ -15,12 +15,9 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::core::build::builder::BuildContext; -use crate::core::build::common; use crate::core::build::language::asm::common as asm; -use std::fs; -use std::path::Path; -use std::process::Command; +use crate::core::build::{builder::BuildContext, common}; +use std::{fs, path::Path, process::Command}; /// Builds GAS (`.s`) sources via the GNU Assembler. /// diff --git a/src/core/build/language/asm/masm/mod.rs b/src/core/build/language/asm/masm/mod.rs index 239092e..14e24e5 100644 --- a/src/core/build/language/asm/masm/mod.rs +++ b/src/core/build/language/asm/masm/mod.rs @@ -1,9 +1,6 @@ -use crate::core::build::builder::BuildContext; -use crate::core::build::common; use crate::core::build::language::asm::common as asm; -use std::fs; -use std::path::Path; -use std::process::Command; +use crate::core::build::{builder::BuildContext, common}; +use std::{fs, path::Path, process::Command}; /// Builds MASM (`.asm`) sources via `ml`. /// diff --git a/src/core/build/language/asm/nasm/mod.rs b/src/core/build/language/asm/nasm/mod.rs index 10aedfd..6f1ff60 100644 --- a/src/core/build/language/asm/nasm/mod.rs +++ b/src/core/build/language/asm/nasm/mod.rs @@ -16,12 +16,9 @@ // along with this program. If not, see . /// Support for NASM assembly language in the DCR build system. -use crate::core::build::builder::BuildContext; -use crate::core::build::common; use crate::core::build::language::asm::common as asm; -use std::fs; -use std::path::Path; -use std::process::Command; +use crate::core::build::{builder::BuildContext, common}; +use std::{fs, path::Path, process::Command}; /// Builds assembly sources using the NASM assembler. /// diff --git a/src/core/build/language/cxx/qt.rs b/src/core/build/language/cxx/qt.rs index aa509ed..e2dfb7c 100644 --- a/src/core/build/language/cxx/qt.rs +++ b/src/core/build/language/cxx/qt.rs @@ -15,8 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::core::build::builder::BuildContext; -use crate::core::build::common; +use crate::core::{build::builder::BuildContext, build::common}; use crate::utils::build::run_pkg_config; use std::fs; use std::path::{Path, PathBuf}; diff --git a/src/core/build/language/llvm_ir/mod.rs b/src/core/build/language/llvm_ir/mod.rs index 0b121dc..eb04806 100644 --- a/src/core/build/language/llvm_ir/mod.rs +++ b/src/core/build/language/llvm_ir/mod.rs @@ -1,10 +1,6 @@ -use crate::core::build::builder::BuildContext; -use crate::core::build::common; -use crate::core::build::language::Language; use crate::core::build::language::asm::common as asm; -use std::fs; -use std::path::Path; -use std::process::Command; +use crate::core::build::{builder::BuildContext, common, language::Language}; +use std::{fs, path::Path, process::Command}; /// Represents the LLVM IR language implementation for the build system. pub struct LlvmIr; diff --git a/src/core/build/steps.rs b/src/core/build/steps.rs index c8a6ed9..b72f7d6 100644 --- a/src/core/build/steps.rs +++ b/src/core/build/steps.rs @@ -15,8 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use crate::core::build::engine::ToolchainExecs; -use crate::core::build_config::Config; +use crate::core::{build::engine::ToolchainExecs, build_config::Config}; use crate::utils::build::{VersionInfo, profile_table, substitute_vars}; use glob::glob; use std::fs; diff --git a/src/core/build_config.rs b/src/core/build_config.rs index d2070a9..58efa14 100644 --- a/src/core/build_config.rs +++ b/src/core/build_config.rs @@ -21,8 +21,7 @@ use serde::Deserialize; use std::collections::BTreeMap; use std::fs; use std::path::{Path, PathBuf}; -use toml::Value; -use toml::map::Map; +use toml::{Value, map::Map}; use toml_edit::{DocumentMut, Item, Table}; const DEFAULT_VERSION: &str = "0.1.0"; diff --git a/src/core/deps/lock.rs b/src/core/deps/lock.rs index c404875..2ff50fc 100644 --- a/src/core/deps/lock.rs +++ b/src/core/deps/lock.rs @@ -15,8 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use std::fs; -use std::path::Path; +use std::{fs, path::Path}; /// Represents a locked dependency entry containing its name, version, source, and checksum. #[derive(Debug, Clone)] diff --git a/src/core/registry.rs b/src/core/registry.rs index 31d6bc5..7f27ab9 100644 --- a/src/core/registry.rs +++ b/src/core/registry.rs @@ -17,9 +17,7 @@ /// Registry configuration management for DCR. use serde::{Deserialize, Serialize}; -use std::collections::HashMap; -use std::fs; -use std::path::PathBuf; +use std::{collections::HashMap, fs, path::PathBuf}; /// Represents a registry configuration entry with its URL and priority. #[derive(Debug, Serialize, Deserialize)] diff --git a/src/core/runner.rs b/src/core/runner.rs index 7d6255f..47e8bf2 100644 --- a/src/core/runner.rs +++ b/src/core/runner.rs @@ -16,8 +16,7 @@ // along with this program. If not, see . use crate::platform; -use std::path::Path; -use std::process::Command; +use std::{path::Path, process::Command}; /// Runs the built binary for a project, forwarding `bin_args`. /// diff --git a/src/core/vcs/git.rs b/src/core/vcs/git.rs index b6f9bde..6736717 100644 --- a/src/core/vcs/git.rs +++ b/src/core/vcs/git.rs @@ -15,8 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use std::fs; -use std::path::Path; +use std::{fs, path::Path}; /// Initializes a Git repository in the target directory and configures its `.gitignore` file. /// diff --git a/src/utils/git.rs b/src/utils/git.rs index fb0d790..249f97b 100644 --- a/src/utils/git.rs +++ b/src/utils/git.rs @@ -1,5 +1,4 @@ -use std::path::Path; -use std::process::Command; +use std::{path::Path, process::Command}; /// Checks if the `git` executable is available in the system's PATH. ///