mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Refactor: PAtomicInfo class
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use std::{
|
||||
io::Write,
|
||||
path::Path,
|
||||
sync::{
|
||||
atomic::{AtomicBool, AtomicU64, AtomicU8, AtomicUsize, Ordering},
|
||||
Arc, RwLock,
|
||||
@@ -56,6 +57,16 @@ pub struct PAtomicInfo {
|
||||
pub no_permissions: AtomicBool,
|
||||
}
|
||||
|
||||
impl PAtomicInfo {
|
||||
pub fn clear_state(&self, dir: &Path) {
|
||||
self.state.store(Operation::INDEXING, ORDERING);
|
||||
let dir_name = dir.to_string_lossy().to_string();
|
||||
self.current_path.set(dir_name);
|
||||
self.total_file_size.store(0, ORDERING);
|
||||
self.file_number.store(0, ORDERING);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
fn format_indicator_str(data: &PAtomicInfo, progress_char_i: usize, status: &str) -> String {
|
||||
format!(
|
||||
|
||||
Reference in New Issue
Block a user