From c72f54243b5039f2f52f178729e0a03cd92c2bd7 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Thu, 2 Mar 2023 11:50:19 +0900 Subject: [PATCH] Add rustfmt --- .editorconfig | 10 ++++++++++ rustfmt.toml | 1 + shell.nix | 5 ++++- src/main.rs | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .editorconfig create mode 100644 rustfmt.toml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..0fe6d30 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = tab +indent_size = tab +smart_tab = true diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..218e203 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +hard_tabs = true diff --git a/shell.nix b/shell.nix index eb56966..f2cdcd5 100644 --- a/shell.nix +++ b/shell.nix @@ -1,5 +1,8 @@ { pkgs ? import {} }: pkgs.mkShell { - packages = [ pkgs.cargo ]; + packages = [ + pkgs.cargo + pkgs.rustfmt + ]; } diff --git a/src/main.rs b/src/main.rs index e7a11a9..a30eb95 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,3 @@ fn main() { - println!("Hello, world!"); + println!("Hello, world!"); }