diff --git a/build.rs b/build.rs index 3f49feb..c814e56 100644 --- a/build.rs +++ b/build.rs @@ -1,12 +1,19 @@ -use std::{error::Error, fs::{self, File}, io::{BufRead, BufReader, Write}, path::Path}; +use std::{ + error::Error, + fs::{self, File}, + io::{BufRead, BufReader, Write}, + path::Path, +}; use toml::Table; - -fn package_version>(path : P) -> Result> { +fn package_version>(path: P) -> Result> { let cargo_toml = fs::read_to_string(path)?; let value: Table = cargo_toml.parse::()?; - Ok(value["package"]["version"].as_str().map(|s| s.to_string()).expect("Failed to get package version")) + Ok(value["package"]["version"] + .as_str() + .map(|s| s.to_string()) + .expect("Failed to get package version")) } fn write_version<'a>(f: &'a mut File, package_version: &'a str) -> Result<&'a str, Box> { @@ -65,8 +72,14 @@ fn main() { } let package_version = package_version("Cargo.toml").expect("Failed to get package version"); - let dest_path = std::path::Path::new("rar-common").join("src").join("version.rs"); - if dest_path.exists() && fs::read_to_string(&dest_path).unwrap().ends_with(&format!("\"{}\";\n",package_version)) { + let dest_path = std::path::Path::new("rar-common") + .join("src") + .join("version.rs"); + if dest_path.exists() + && fs::read_to_string(&dest_path) + .unwrap() + .ends_with(&format!("\"{}\";\n", package_version)) + { return; } let mut f = File::create(dest_path).unwrap(); @@ -88,4 +101,4 @@ fn main() { if let Err(err) = set_readme_version(&package_version, "README.md") { eprintln!("cargo:warning={}", err); } -} \ No newline at end of file +} diff --git a/rar-common/src/database/mod.rs b/rar-common/src/database/mod.rs index e61025c..0fdadcb 100644 --- a/rar-common/src/database/mod.rs +++ b/rar-common/src/database/mod.rs @@ -8,7 +8,6 @@ use chrono::Duration; use linked_hash_set::LinkedHashSet; use serde::{de, Deserialize, Serialize}; use tracing::debug; -use tracing_subscriber::field::debug; use self::{migration::Migration, options::EnvKey, structs::SConfig, versionning::Versioning}; diff --git a/rar-common/src/database/versionning.rs b/rar-common/src/database/versionning.rs index f98a1df..f46ec9f 100644 --- a/rar-common/src/database/versionning.rs +++ b/rar-common/src/database/versionning.rs @@ -33,8 +33,6 @@ impl Default for Versioning { } } -pub(crate) const JSON_MIGRATIONS: &[Migration] = &[ -]; +pub(crate) const JSON_MIGRATIONS: &[Migration] = &[]; -pub(crate) const SETTINGS_MIGRATIONS: &[Migration] = &[ -]; +pub(crate) const SETTINGS_MIGRATIONS: &[Migration] = &[]; diff --git a/xtask/src/util.rs b/xtask/src/util.rs index 9d82c42..22a43bd 100644 --- a/xtask/src/util.rs +++ b/xtask/src/util.rs @@ -2,7 +2,8 @@ use std::{ fs::{self, File}, io, os::{fd::AsRawFd, unix::fs::MetadataExt}, - path::Path, process::Command, + path::Path, + process::Command, }; use anyhow::{anyhow, Context}; @@ -120,7 +121,9 @@ fn read_or_dac_override(effective: bool) -> Result<(), capctl::Error> { } pub fn change_dir_to_git_root() -> Result<(), anyhow::Error> { - let output = Command::new("git").args(&["rev-parse", "--show-toplevel"]).output()?; + let output = Command::new("git") + .args(&["rev-parse", "--show-toplevel"]) + .output()?; let git_root = String::from_utf8(output.stdout)?.trim().to_string(); debug!("Changing directory to git root: {}", git_root); std::env::set_current_dir(git_root)?;