From 3138c5de7f5bafd1dddf95ed6e0d04adca3af61b Mon Sep 17 00:00:00 2001 From: Mohammad Kanaan Date: Mon, 27 Jul 2026 11:43:44 +0300 Subject: [PATCH] chore: add rustfmt, anyhow, and zed config --- .zed/settings.json | 13 +++++++++++++ Cargo.lock | 7 +++++++ Cargo.toml | 1 + rustfmt.toml | 6 ++++++ 4 files changed, 27 insertions(+) create mode 100644 .zed/settings.json create mode 100644 rustfmt.toml diff --git a/.zed/settings.json b/.zed/settings.json new file mode 100644 index 0000000..2625556 --- /dev/null +++ b/.zed/settings.json @@ -0,0 +1,13 @@ +{ + "languages": { + "Rust": { + "format_on_save": "on", + "formatter": { + "external": { + "command": "rustfmt", + "arguments": ["--edition", "2021"], + }, + }, + }, + }, +} diff --git a/Cargo.lock b/Cargo.lock index 80c0b75..bb00e0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,6 +52,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + [[package]] name = "clap" version = "4.6.4" @@ -138,6 +144,7 @@ dependencies = [ name = "smolgrep" version = "0.1.0" dependencies = [ + "anyhow", "clap", ] diff --git a/Cargo.toml b/Cargo.toml index 3bda267..cbc571b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,4 +4,5 @@ version = "0.1.0" edition = "2024" [dependencies] +anyhow = "1.0.104" clap = { version = "4.6.4", features = ["derive"] } diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..9047241 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,6 @@ +# Prettier-like Rust formatting +edition = "2021" +max_width = 100 +tab_spaces = 4 +hard_tabs = false +use_small_heuristics = "Max"