#![forbid(unsafe_code)]
#![forbid(missing_docs)]
#![deny(clippy::all)]
mod diff;
mod revlog;
mod status;
pub mod sync;
pub use crate::{
diff::{AsyncDiff, DiffParams},
revlog::AsyncLog,
status::AsyncStatus,
sync::{
diff::{DiffLine, DiffLineType, FileDiff},
status::{StatusItem, StatusItemType},
utils::is_repo,
},
};
use std::{
collections::hash_map::DefaultHasher,
hash::{Hash, Hasher},
time::{SystemTime, UNIX_EPOCH},
};
#[derive(Copy, Clone, Debug)]
pub enum AsyncNotification {
Status,
Diff,
Log,
}
pub static CWD: &str = "./";
pub fn hash<T: Hash + ?Sized>(v: &T) -> u64 {
let mut hasher = DefaultHasher::new();
v.hash(&mut hasher);
hasher.finish()
}
pub fn current_tick() -> u64 {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap()
.as_millis() as u64
}