diff options
| author | mo8it <mo8it@proton.me> | 2025-02-18 20:10:52 +0100 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2025-02-18 20:10:52 +0100 |
| commit | d9872f2615a11ce94deb85c8f1c215d69abd7992 (patch) | |
| tree | a525e7eaac10e75db45921f79578d3da33bf1a13 /src/init.rs | |
| parent | 298be671b9108e490fcef6b8febace8659ec710a (diff) | |
Upgrade to edition 2024
Diffstat (limited to 'src/init.rs')
| -rw-r--r-- | src/init.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/init.rs b/src/init.rs index ce49bb6..208425c 100644 --- a/src/init.rs +++ b/src/init.rs @@ -1,7 +1,7 @@ -use anyhow::{bail, Context, Result}; +use anyhow::{Context, Result, bail}; use crossterm::{ - style::{Attribute, Color, ResetColor, SetAttribute, SetForegroundColor}, QueueableCommand, + style::{Attribute, Color, ResetColor, SetAttribute, SetForegroundColor}, }; use serde::Deserialize; use std::{ @@ -57,7 +57,9 @@ pub fn init() -> Result<()> { if !workspace_manifest_content.contains("[workspace]\n") && !workspace_manifest_content.contains("workspace.") { - bail!("The current directory is already part of a Cargo project.\nPlease initialize Rustlings in a different directory"); + bail!( + "The current directory is already part of a Cargo project.\nPlease initialize Rustlings in a different directory" + ); } stdout.write_all(b"This command will create the directory `rustlings/` as a member of this Cargo workspace.\nPress ENTER to continue ")?; @@ -75,7 +77,9 @@ pub fn init() -> Result<()> { .stdout(Stdio::null()) .status()?; if !status.success() { - bail!("Failed to initialize a new Cargo workspace member.\nPlease initialize Rustlings in a different directory"); + bail!( + "Failed to initialize a new Cargo workspace member.\nPlease initialize Rustlings in a different directory" + ); } stdout.write_all(b"The directory `rustlings` has been added to `workspace.members` in the `Cargo.toml` file of this Cargo workspace.\n")?; |
