2019-05-24 10:25:55 +02:00
|
|
|
// stdlib types
|
|
|
|
pub(crate) use std::{
|
|
|
|
borrow::Cow,
|
2020-02-11 12:08:57 +01:00
|
|
|
cmp::Reverse,
|
2020-02-03 13:39:48 +01:00
|
|
|
collections::{BTreeMap, BTreeSet, HashMap},
|
2020-01-16 08:37:12 +01:00
|
|
|
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},
|
2020-02-14 09:12:49 +01:00
|
|
|
iter::{self, Sum},
|
2020-02-14 11:16:19 +01:00
|
|
|
num::{ParseFloatError, ParseIntError, TryFromIntError},
|
2020-02-14 09:12:49 +01:00
|
|
|
ops::{AddAssign, Div, DivAssign, Mul, MulAssign, SubAssign},
|
2020-02-06 01:01:44 +01:00
|
|
|
path::{self, Path, PathBuf},
|
2020-01-30 14:54:08 +01:00
|
|
|
process::{self, Command, ExitStatus},
|
2020-01-16 08:37:12 +01:00
|
|
|
str::{self, FromStr},
|
2019-05-24 10:25:55 +02:00
|
|
|
time::{SystemTime, SystemTimeError},
|
2020-01-05 03:58:42 +01:00
|
|
|
usize,
|
2019-05-24 10:25:55 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
// dependencies
|
2020-02-11 12:08:57 +01:00
|
|
|
pub(crate) use bendy::{decoding::FromBencode, encoding::ToBencode, value::Value};
|
2020-02-04 16:55:50 +01:00
|
|
|
pub(crate) use chrono::{TimeZone, Utc};
|
2020-02-06 06:47:12 +01:00
|
|
|
pub(crate) use globset::{Glob, GlobMatcher};
|
2019-05-24 10:25:55 +02:00
|
|
|
pub(crate) use libc::EXIT_FAILURE;
|
|
|
|
pub(crate) use regex::{Regex, RegexSet};
|
2020-02-14 11:16:19 +01:00
|
|
|
pub(crate) use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer};
|
2020-02-14 09:12:49 +01:00
|
|
|
pub(crate) use serde_hex::SerHex;
|
|
|
|
pub(crate) use serde_with::rust::unwrap_or_skip;
|
2019-05-24 10:25:55 +02:00
|
|
|
pub(crate) use sha1::Sha1;
|
|
|
|
pub(crate) use snafu::{ResultExt, Snafu};
|
2020-01-05 03:58:42 +01:00
|
|
|
pub(crate) use static_assertions::const_assert;
|
2020-01-24 23:17:31 +01:00
|
|
|
pub(crate) use structopt::{
|
|
|
|
clap::{AppSettings, ArgSettings},
|
|
|
|
StructOpt,
|
|
|
|
};
|
2020-02-04 16:55:50 +01:00
|
|
|
pub(crate) use unicode_width::UnicodeWidthStr;
|
2020-02-14 11:16:19 +01:00
|
|
|
pub(crate) use url::{Host, Url};
|
2019-05-24 10:25:55 +02:00
|
|
|
pub(crate) use walkdir::WalkDir;
|
|
|
|
|
|
|
|
// modules
|
2020-03-07 09:52:44 +01:00
|
|
|
pub(crate) use crate::{consts, error};
|
2019-05-24 10:25:55 +02:00
|
|
|
|
|
|
|
// traits
|
2020-01-05 03:58:42 +01:00
|
|
|
pub(crate) use crate::{
|
2020-01-30 14:54:08 +01:00
|
|
|
into_u64::IntoU64, into_usize::IntoUsize, path_ext::PathExt,
|
|
|
|
platform_interface::PlatformInterface, reckoner::Reckoner,
|
2020-01-05 03:58:42 +01:00
|
|
|
};
|
2019-05-24 10:25:55 +02:00
|
|
|
|
|
|
|
// structs and enums
|
|
|
|
pub(crate) use crate::{
|
2020-03-07 07:50:04 +01:00
|
|
|
arguments::Arguments, bytes::Bytes, env::Env, error::Error, file_info::FileInfo,
|
|
|
|
file_path::FilePath, file_status::FileStatus, files::Files, hasher::Hasher, info::Info,
|
|
|
|
lint::Lint, linter::Linter, md5_digest::Md5Digest, metainfo::Metainfo, mode::Mode, node::Node,
|
|
|
|
options::Options, piece_length_picker::PieceLengthPicker, piece_list::PieceList,
|
|
|
|
platform::Platform, sha1_digest::Sha1Digest, status::Status, style::Style,
|
|
|
|
subcommand::Subcommand, table::Table, target::Target, torrent_summary::TorrentSummary,
|
|
|
|
use_color::UseColor, verifier::Verifier, walker::Walker,
|
2019-05-24 10:25:55 +02:00
|
|
|
};
|
|
|
|
|
2020-02-14 09:12:49 +01:00
|
|
|
// type aliases
|
|
|
|
pub(crate) type Result<T, E = Error> = std::result::Result<T, E>;
|
2020-01-14 09:52:27 +01:00
|
|
|
|
2020-02-04 16:55:50 +01:00
|
|
|
#[cfg(test)]
|
2020-02-14 09:12:49 +01:00
|
|
|
mod test {
|
|
|
|
// test stdlib types
|
|
|
|
pub(crate) use std::{
|
|
|
|
cell::RefCell,
|
|
|
|
io::Cursor,
|
|
|
|
ops::{Deref, DerefMut},
|
|
|
|
rc::Rc,
|
|
|
|
time::{Duration, Instant},
|
|
|
|
};
|
2020-02-04 16:55:50 +01:00
|
|
|
|
2020-02-14 09:12:49 +01:00
|
|
|
// test dependencies
|
|
|
|
pub(crate) use tempfile::TempDir;
|
|
|
|
pub(crate) use temptree::temptree;
|
2020-02-11 12:08:57 +01:00
|
|
|
|
2020-02-14 09:12:49 +01:00
|
|
|
// test structs and enums
|
|
|
|
pub(crate) use crate::{capture::Capture, test_env::TestEnv, test_env_builder::TestEnvBuilder};
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
pub(crate) use test::*;
|