~iptq/garbage

ref: 02ba29053be29149ec4ca4f73cd375f02f2cf21b garbage/src/lib.rs -rw-r--r-- 788 bytes
02ba2905Michael Zhang fix panic problem by not converting to utf-8 all the time 1 year, 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! garbage

#![warn(missing_docs)]

#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate structopt;
extern crate log;
#[macro_use]
extern crate anyhow;
#[macro_use]
extern crate thiserror;

#[macro_use]
mod utils;

mod dir;
mod errors;
mod info;
mod mounts;
pub mod ops;

use std::path::PathBuf;

use xdg::BaseDirectories;

pub use crate::dir::TrashDir;
pub use crate::errors::Error;
pub use crate::info::TrashInfo;
use crate::mounts::Mounts;

lazy_static! {
    #[allow(missing_docs)]
    pub static ref MOUNTS: Mounts = Mounts::read().unwrap();
    static ref XDG: BaseDirectories = BaseDirectories::new().unwrap();
    static ref HOME_TRASH: TrashDir = TrashDir::get_home_trash();
    static ref HOME_MOUNT: PathBuf = MOUNTS.get_mount_point(HOME_TRASH.path()).unwrap();
}