chore: move file_utils and hash modules to util folder

This commit is contained in:
Gabriele Musco 2024-09-01 19:47:39 +02:00
commit 0a59954f62
23 changed files with 25 additions and 22 deletions

View file

@ -1,9 +1,9 @@
use crate::{
build_tools::{cmake::Cmake, git::Git},
file_utils::rm_rf,
profile::Profile,
termcolor::TermColor,
ui::job_worker::job::WorkerJob,
util::file_utils::rm_rf,
};
use std::collections::{HashMap, VecDeque};

View file

@ -1,9 +1,9 @@
use crate::{
build_tools::{cmake::Cmake, git::Git},
file_utils::rm_rf,
profile::Profile,
termcolor::TermColor,
ui::job_worker::job::WorkerJob,
util::file_utils::rm_rf,
};
use std::{
collections::{HashMap, VecDeque},

View file

@ -1,9 +1,9 @@
use crate::{
build_tools::{cmake::Cmake, git::Git},
file_utils::rm_rf,
profile::Profile,
termcolor::TermColor,
ui::job_worker::job::WorkerJob,
util::file_utils::rm_rf,
};
use std::{
collections::{HashMap, VecDeque},

View file

@ -1,9 +1,9 @@
use crate::{
build_tools::{cmake::Cmake, git::Git},
file_utils::rm_rf,
profile::Profile,
termcolor::TermColor,
ui::job_worker::job::WorkerJob,
util::file_utils::rm_rf,
};
use std::{
collections::{HashMap, VecDeque},

View file

@ -1,9 +1,9 @@
use crate::{
build_tools::{cmake::Cmake, git::Git},
file_utils::rm_rf,
profile::Profile,
termcolor::TermColor,
ui::job_worker::job::WorkerJob,
util::file_utils::rm_rf,
};
use std::{
collections::{HashMap, VecDeque},

View file

@ -1,9 +1,9 @@
use crate::{
build_tools::{cmake::Cmake, git::Git},
file_utils::rm_rf,
profile::Profile,
termcolor::TermColor,
ui::job_worker::job::WorkerJob,
util::file_utils::rm_rf,
};
use std::{
collections::{HashMap, VecDeque},

View file

@ -1,7 +1,7 @@
use crate::{
file_utils::get_writer,
profile::{Profile, XRServiceType},
runner::{Runner, RunnerStatus},
util::file_utils::get_writer,
};
use nix::{
sys::signal::{

View file

@ -1,13 +1,13 @@
use crate::{
constants::CMD_NAME,
device_prober::PhysicalXRDevice,
file_utils::get_writer,
paths::get_config_dir,
profile::Profile,
profiles::{
lighthouse::lighthouse_profile, openhmd::openhmd_profile, simulated::simulated_profile,
survive::survive_profile, wivrn::wivrn_profile, wmr::wmr_profile,
},
util::file_utils::get_writer,
};
use serde::{de::Error, Deserialize, Serialize};
use std::{

View file

@ -1,4 +1,6 @@
use crate::{constants::APP_ID, file_utils::get_writer, hash::sha256, paths::get_cache_dir};
use crate::{
constants::APP_ID, paths::get_cache_dir, util::file_utils::get_writer, util::hash::sha256,
};
use reqwest::{
header::{HeaderMap, USER_AGENT},
Method,

View file

@ -1,7 +1,7 @@
use crate::{
file_utils::{copy_file, deserialize_file, get_writer, set_file_readonly},
paths::{get_backup_dir, SYSTEM_PREFIX},
profile::Profile,
util::file_utils::{copy_file, deserialize_file, get_writer, set_file_readonly},
xdg::XDG,
};
use serde::{ser::Error, Deserialize, Serialize};

View file

@ -1,7 +1,7 @@
use std::path::{Path, PathBuf};
use crate::{
file_utils::{deserialize_file, get_writer},
util::file_utils::{deserialize_file, get_writer},
xdg::XDG,
};
use serde::{Deserialize, Serialize};

View file

@ -1,9 +1,9 @@
use std::path::{Path, PathBuf};
use crate::{
file_utils::{copy_file, deserialize_file, get_writer, set_file_readonly},
paths::get_backup_dir,
profile::Profile,
util::file_utils::{copy_file, deserialize_file, get_writer, set_file_readonly},
xdg::XDG,
};
use serde::{ser::Error, Deserialize, Serialize};

View file

@ -1,5 +1,5 @@
use crate::{
file_utils::{deserialize_file, get_writer},
util::file_utils::{deserialize_file, get_writer},
xdg::XDG,
};
use serde::{Deserialize, Serialize};

View file

@ -1,4 +1,4 @@
use crate::file_utils::get_reader;
use crate::util::file_utils::get_reader;
use std::{
error::Error,
fmt::Display,

View file

@ -1,4 +1,4 @@
use crate::file_utils::get_reader;
use crate::util::file_utils::get_reader;
use std::{
fmt::Display,
io::{BufRead, Read},

View file

@ -29,9 +29,7 @@ pub mod device_prober;
pub mod downloader;
pub mod env_var_descriptions;
pub mod file_builders;
pub mod file_utils;
pub mod gpu_profile;
pub mod hash;
pub mod is_appimage;
pub mod linux_distro;
pub mod log_level;
@ -45,6 +43,7 @@ pub mod steam_linux_runtime_injector;
pub mod steamvr_utils;
pub mod termcolor;
pub mod ui;
pub mod util;
pub mod vulkaninfo;
pub mod xdg;
pub mod xr_devices;

View file

@ -1,6 +1,6 @@
use crate::{
file_utils::get_writer,
paths::{get_data_dir, BWRAP_SYSTEM_PREFIX, SYSTEM_PREFIX},
util::file_utils::get_writer,
xdg::XDG,
};
use nix::NixPath;

View file

@ -1,7 +1,7 @@
use crate::{
file_utils::{copy_file, get_writer},
paths::{get_backup_dir, get_home_dir},
profile::Profile,
util::file_utils::{copy_file, get_writer},
};
use anyhow::bail;
use std::{

View file

@ -37,7 +37,6 @@ use crate::{
set_current_openvrpaths_to_profile, set_current_openvrpaths_to_steam,
},
},
file_utils::{setcap_cap_sys_nice_eip, setcap_cap_sys_nice_eip_cmd},
is_appimage::IS_APPIMAGE,
linux_distro::LinuxDistro,
openxr_prober::is_openxr_ready,
@ -47,6 +46,7 @@ use crate::{
steam_linux_runtime_injector::{
restore_runtime_entrypoint, set_runtime_entrypoint_launch_opts_from_profile,
},
util::file_utils::{setcap_cap_sys_nice_eip, setcap_cap_sys_nice_eip_cmd},
xr_devices::XRDevice,
};
use adw::{prelude::*, ResponseAppearance};

View file

@ -14,12 +14,12 @@ use super::{
use crate::{
config::Config,
dependencies::common::dep_pkexec,
file_utils::{get_writer, mount_has_nosuid},
gpu_profile::{get_amd_gpu_power_profile, GpuPowerProfile},
paths::{get_data_dir, get_home_dir},
profile::{LighthouseDriver, Profile, XRServiceType},
stateless_action,
steamvr_utils::chaperone_info_exists,
util::file_utils::{get_writer, mount_has_nosuid},
xr_devices::XRDevice,
};
use adw::{prelude::*, ResponseAppearance};

View file

@ -114,7 +114,7 @@ pub fn mount_has_nosuid(path: &Path) -> Result<bool, Errno> {
#[cfg(test)]
mod tests {
use crate::file_utils::mount_has_nosuid;
use super::mount_has_nosuid;
use std::path::Path;
#[test]

2
src/util/mod.rs Normal file
View file

@ -0,0 +1,2 @@
pub mod file_utils;
pub mod hash;