Add anyhow

This commit is contained in:
mo8it 2024-03-25 03:46:56 +01:00
parent b3aef377be
commit efa9f57048
3 changed files with 12 additions and 1 deletions

7
Cargo.lock generated
View file

@ -59,6 +59,12 @@ dependencies = [
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
[[package]]
name = "anyhow"
version = "1.0.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247"
[[package]] [[package]]
name = "assert_cmd" name = "assert_cmd"
version = "2.0.14" version = "2.0.14"
@ -525,6 +531,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
name = "rustlings" name = "rustlings"
version = "5.6.1" version = "5.6.1"
dependencies = [ dependencies = [
"anyhow",
"assert_cmd", "assert_cmd",
"clap", "clap",
"console", "console",

View file

@ -9,6 +9,7 @@ authors = [
edition = "2021" edition = "2021"
[dependencies] [dependencies]
anyhow = "1.0.81"
clap = { version = "4.5.2", features = ["derive"] } clap = { version = "4.5.2", features = ["derive"] }
console = "0.15.8" console = "0.15.8"
glob = "0.3.0" glob = "0.3.0"

View file

@ -2,6 +2,7 @@ use crate::exercise::{Exercise, ExerciseList};
use crate::project::RustAnalyzerProject; use crate::project::RustAnalyzerProject;
use crate::run::{reset, run}; use crate::run::{reset, run};
use crate::verify::verify; use crate::verify::verify;
use anyhow::Result;
use clap::{Parser, Subcommand}; use clap::{Parser, Subcommand};
use console::Emoji; use console::Emoji;
use notify_debouncer_mini::notify::{self, RecursiveMode}; use notify_debouncer_mini::notify::{self, RecursiveMode};
@ -84,7 +85,7 @@ enum Subcommands {
Lsp, Lsp,
} }
fn main() { fn main() -> Result<()> {
let args = Args::parse(); let args = Args::parse();
if args.command.is_none() { if args.command.is_none() {
@ -243,6 +244,8 @@ fn main() {
} }
}, },
} }
Ok(())
} }
fn spawn_watch_shell( fn spawn_watch_shell(