From 4b11b4ce62bdb6b598cfa187d232de30d4d97ca1 Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 28 Apr 2025 01:45:11 +0200 Subject: [PATCH] Move module definitions after imports The style guide says: "Put imports before module declarations." See https://doc.rust-lang.org/style-guide/items.html Cargo also does this automatically. --- gdn-cli/src/commands.rs | 4 ++-- gdn-cli/src/main.rs | 4 ++-- gdn/src/data.rs | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gdn-cli/src/commands.rs b/gdn-cli/src/commands.rs index 8539be5..acc76df 100644 --- a/gdn-cli/src/commands.rs +++ b/gdn-cli/src/commands.rs @@ -1,9 +1,9 @@ -mod migrate; - use clap::Parser; use crate::Environment; +mod migrate; + #[derive(Debug, Parser)] pub enum Command { Migrate(migrate::Command), diff --git a/gdn-cli/src/main.rs b/gdn-cli/src/main.rs index b15f4a6..a920c61 100644 --- a/gdn-cli/src/main.rs +++ b/gdn-cli/src/main.rs @@ -1,11 +1,11 @@ -mod commands; - use std::path::PathBuf; use clap::Parser; use crate::commands::Command; +mod commands; + /// GedächtNAS - external storage for your brain. #[derive(Debug, Parser)] #[command(version)] diff --git a/gdn/src/data.rs b/gdn/src/data.rs index 1b8ba87..8f57dc0 100644 --- a/gdn/src/data.rs +++ b/gdn/src/data.rs @@ -1,13 +1,13 @@ -mod datadir; -mod lockfile; -mod v0; -mod v1; - use std::path::PathBuf; use anyhow::Context; use directories::ProjectDirs; +mod datadir; +mod lockfile; +mod v0; +mod v1; + pub use self::{ datadir::{LockedDataDir, UnlockedDataDir}, v1::{VERSION, load_state, save_state},