intermodal/src/common.rs

72 lines
1.9 KiB
Rust
Raw Normal View History

2019-05-24 10:25:55 +02:00
// stdlib types
pub(crate) use std::{
borrow::Cow,
cmp::{Ordering, Reverse},
collections::{BTreeMap, BTreeSet, HashMap},
convert::{Infallible, TryInto},
2019-05-24 10:25:55 +02:00
env,
ffi::{OsStr, OsString},
fmt::{self, Display, Formatter},
fs::{self, File},
hash::Hash,
io::{self, Read, Write},
num::ParseFloatError,
ops::{Div, DivAssign, Mul, MulAssign},
path::{self, Path, PathBuf},
process::{self, Command, ExitStatus},
str::{self, FromStr},
2019-05-24 10:25:55 +02:00
time::{SystemTime, SystemTimeError},
usize,
2019-05-24 10:25:55 +02:00
};
// dependencies
pub(crate) use chrono::{TimeZone, Utc};
2019-05-24 10:25:55 +02:00
pub(crate) use libc::EXIT_FAILURE;
pub(crate) use regex::{Regex, RegexSet};
pub(crate) use serde::{Deserialize, Serialize};
pub(crate) use sha1::Sha1;
pub(crate) use snafu::{ResultExt, Snafu};
pub(crate) use static_assertions::const_assert;
pub(crate) use structopt::{
clap::{AppSettings, ArgSettings},
StructOpt,
};
pub(crate) use unicode_width::UnicodeWidthStr;
2019-05-24 10:25:55 +02:00
pub(crate) use url::Url;
pub(crate) use walkdir::WalkDir;
// modules
pub(crate) use crate::{bencode, consts, error, use_color};
2019-05-24 10:25:55 +02:00
// traits
pub(crate) use crate::{
into_u64::IntoU64, into_usize::IntoUsize, path_ext::PathExt,
platform_interface::PlatformInterface, reckoner::Reckoner,
};
2019-05-24 10:25:55 +02:00
// structs and enums
pub(crate) use crate::{
bytes::Bytes, env::Env, error::Error, file_info::FileInfo, file_path::FilePath, files::Files,
hasher::Hasher, info::Info, lint::Lint, linter::Linter, metainfo::Metainfo, mode::Mode, opt::Opt,
piece_length_picker::PieceLengthPicker, platform::Platform, style::Style, table::Table,
target::Target, torrent_summary::TorrentSummary, use_color::UseColor, walker::Walker,
2019-05-24 10:25:55 +02:00
};
// test stdlib types
#[cfg(test)]
pub(crate) use std::{
cell::RefCell,
io::Cursor,
ops::{Deref, DerefMut},
rc::Rc,
time::{Duration, Instant},
};
// test modules
#[cfg(test)]
pub(crate) use crate::testing;
// test structs and enums
#[cfg(test)]
pub(crate) use crate::{capture::Capture, test_env::TestEnv, test_env_builder::TestEnvBuilder};