Skip to content

Commit

Permalink
Format Rust code using rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jan 1, 2025
1 parent 7340aeb commit e606250
Show file tree
Hide file tree
Showing 21 changed files with 75 additions and 129 deletions.
4 changes: 2 additions & 2 deletions rar-common/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ use std::sync::Mutex;

use capctl::CapSet;

#[cfg(feature = "finder")]
use log::debug;
#[cfg(feature = "finder")]
use serde_json::Value;
use strum::EnumIs;
#[cfg(feature = "finder")]
use log::debug;

#[cfg(feature = "finder")]
use crate::database::finder::{Cred, ExecSettings, FilterMatcher, TaskMatch, UserMin};
Expand Down
2 changes: 1 addition & 1 deletion rar-common/src/database/finder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ use std::{

use capctl::CapSet;
use glob::Pattern;
use log::{debug, warn};
use nix::{
libc::dev_t,
unistd::{Group, Pid, User},
};
#[cfg(feature = "pcre2")]
use pcre2::bytes::RegexBuilder;
use strum::EnumIs;
use log::{debug, warn};

use crate::database::{
options::{Opt, OptStack},
Expand Down
2 changes: 1 addition & 1 deletion rar-common/src/database/migration.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::error::Error;

use semver::Version;
use log::debug;
use semver::Version;

use crate::version::PACKAGE_VERSION;

Expand Down
7 changes: 4 additions & 3 deletions rar-common/src/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::version::PACKAGE_VERSION;

use chrono::Duration;
use linked_hash_set::LinkedHashSet;
use serde::{de, Deserialize, Serialize};
use log::debug;
use serde::{de, Deserialize, Serialize};

use self::{migration::Migration, options::EnvKey, structs::SConfig, versionning::Versioning};

Expand Down Expand Up @@ -37,7 +37,7 @@ pub fn make_weak_config(config: &Rc<RefCell<SConfig>>) {
}
}

pub fn read_json_config<P:AsRef<Path>>(
pub fn read_json_config<P: AsRef<Path>>(
settings: Rc<RefCell<SettingsFile>>,
settings_path: P,
) -> Result<Rc<RefCell<SConfig>>, Box<dyn Error>> {
Expand All @@ -48,7 +48,8 @@ pub fn read_json_config<P:AsRef<Path>>(
.settings
.as_ref()
.unwrap_or(&default_remote)
.path.as_ref();
.path
.as_ref();
if path.is_none() || path.is_some_and(|p| p == settings_path.as_ref()) {
make_weak_config(&settings.as_ref().borrow().config);
return Ok(settings.as_ref().borrow().config.clone());
Expand Down
2 changes: 1 addition & 1 deletion rar-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ const ROOTASROLE: &str = "target/rootasrole.json";

use std::{cell::RefCell, error::Error, ffi::OsStr, path::PathBuf, rc::Rc};

use serde::{Deserialize, Serialize};
use log::debug;
use serde::{Deserialize, Serialize};

pub mod api;
pub mod database;
Expand Down
2 changes: 1 addition & 1 deletion rar-common/src/plugin/hashchecker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use crate::{
open_with_privileges,
util::{final_path, parse_conf_command},
};
use log::{debug, warn};
use nix::unistd::{access, AccessFlags};
use serde::{Deserialize, Serialize};
use log::{debug, warn};

use libc::FS_IOC_GETFLAGS;
use sha2::Digest;
Expand Down
2 changes: 1 addition & 1 deletion rar-common/src/plugin/hierarchy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use crate::{
},
};

use serde::Deserialize;
use log::{debug, warn};
use serde::Deserialize;

#[derive(Deserialize)]
pub struct Parents(Vec<String>);
Expand Down
4 changes: 2 additions & 2 deletions rar-common/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use std::{
use capctl::{prctl, CapState};
use capctl::{Cap, CapSet, ParseCapError};
use libc::{FS_IOC_GETFLAGS, FS_IOC_SETFLAGS};
use log::{debug, warn};
use serde::Serialize;
use strum::EnumIs;
use log::{debug, warn};

#[cfg(feature = "finder")]
use crate::api::PluginManager;
Expand Down Expand Up @@ -265,8 +265,8 @@ pub fn subsribe(tool: &str) -> Result<(), Box<dyn Error>> {
#[cfg(not(debug_assertions))]
pub fn subsribe(tool: &str) -> Result<(), Box<dyn Error>> {
use env_logger::Env;
use syslog::{BasicLogger, Facility, Formatter3164};
use log::LevelFilter;
use syslog::{BasicLogger, Facility, Formatter3164};
syslog::init(Facility::LOG_AUTH, LevelFilter::Info, Some(tool))?;
Ok(())
}
Expand Down
Loading

0 comments on commit e606250

Please sign in to comment.