2019-05-24 10:25:55 +02:00
|
|
|
// stdlib types
|
|
|
|
pub(crate) use std::{
|
|
|
|
borrow::Cow,
|
2020-03-12 08:23:16 +01:00
|
|
|
char,
|
2020-03-26 02:08:55 +01:00
|
|
|
cmp::{Ordering, Reverse},
|
2020-03-17 11:02:02 +01:00
|
|
|
collections::{BTreeMap, BTreeSet, HashMap, HashSet},
|
2020-04-06 03:17:38 +02:00
|
|
|
convert::{TryFrom, TryInto},
|
2019-05-24 10:25:55 +02:00
|
|
|
env,
|
|
|
|
ffi::{OsStr, OsString},
|
|
|
|
fmt::{self, Display, Formatter},
|
|
|
|
fs::{self, File},
|
|
|
|
hash::Hash,
|
2020-04-03 05:04:12 +02:00
|
|
|
io::{self, BufRead, BufReader, Cursor, Read, Write},
|
2020-03-17 11:02:02 +01:00
|
|
|
iter::{self, Sum},
|
2020-02-14 11:16:19 +01:00
|
|
|
num::{ParseFloatError, ParseIntError, TryFromIntError},
|
2020-03-15 11:22:33 +01:00
|
|
|
ops::{AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign},
|
2020-02-06 01:01:44 +01:00
|
|
|
path::{self, Path, PathBuf},
|
2020-03-20 22:55:42 +01:00
|
|
|
process::{self, ExitStatus},
|
2020-01-16 08:37:12 +01:00
|
|
|
str::{self, FromStr},
|
2020-04-16 13:16:40 +02:00
|
|
|
string::FromUtf8Error,
|
2020-03-17 11:02:02 +01:00
|
|
|
sync::Once,
|
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};
|
2020-04-16 05:17:40 +02:00
|
|
|
pub(crate) use ignore::WalkBuilder;
|
2020-03-12 00:04:22 +01:00
|
|
|
pub(crate) use indicatif::{ProgressBar, ProgressStyle};
|
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-04-03 05:04:12 +02:00
|
|
|
pub(crate) use structopt::{
|
|
|
|
clap::{self, AppSettings},
|
|
|
|
StructOpt,
|
|
|
|
};
|
2020-04-16 13:16:40 +02:00
|
|
|
pub(crate) use strum::{IntoEnumIterator, VariantNames};
|
|
|
|
pub(crate) use strum_macros::{EnumIter, EnumString, EnumVariantNames, IntoStaticStr};
|
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
|
|
|
|
2020-03-17 11:02:02 +01:00
|
|
|
// logging functions
|
|
|
|
#[allow(unused_imports)]
|
|
|
|
pub(crate) use log::trace;
|
|
|
|
|
2019-05-24 10:25:55 +02:00
|
|
|
// modules
|
2020-03-17 11:02:02 +01:00
|
|
|
pub(crate) use crate::{consts, error, host_port_parse_error};
|
2019-05-24 10:25:55 +02:00
|
|
|
|
2020-04-22 07:20:36 +02:00
|
|
|
// functions
|
|
|
|
pub(crate) use crate::xor_args::xor_args;
|
|
|
|
|
2019-05-24 10:25:55 +02:00
|
|
|
// traits
|
2020-01-05 03:58:42 +01:00
|
|
|
pub(crate) use crate::{
|
2020-04-18 23:36:54 +02:00
|
|
|
input_stream::InputStream, into_u64::IntoU64, into_usize::IntoUsize, invariant::Invariant,
|
|
|
|
path_ext::PathExt, platform_interface::PlatformInterface, print::Print, reckoner::Reckoner,
|
|
|
|
step::Step,
|
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-15 11:22:33 +01:00
|
|
|
arguments::Arguments, bytes::Bytes, env::Env, error::Error, file_error::FileError,
|
2020-03-28 03:00:40 +01:00
|
|
|
file_info::FileInfo, file_path::FilePath, file_status::FileStatus, files::Files, hasher::Hasher,
|
|
|
|
host_port::HostPort, host_port_parse_error::HostPortParseError, info::Info, infohash::Infohash,
|
|
|
|
input::Input, input_target::InputTarget, lint::Lint, linter::Linter, magnet_link::MagnetLink,
|
|
|
|
md5_digest::Md5Digest, metainfo::Metainfo, metainfo_error::MetainfoError, mode::Mode,
|
|
|
|
options::Options, output_stream::OutputStream, output_target::OutputTarget,
|
|
|
|
piece_length_picker::PieceLengthPicker, piece_list::PieceList, platform::Platform,
|
2020-03-28 06:46:41 +01:00
|
|
|
sha1_digest::Sha1Digest, shell::Shell, sort_key::SortKey, sort_order::SortOrder,
|
|
|
|
sort_spec::SortSpec, status::Status, style::Style, subcommand::Subcommand, table::Table,
|
2020-03-28 03:00:40 +01:00
|
|
|
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,
|
|
|
|
ops::{Deref, DerefMut},
|
2020-03-20 22:55:42 +01:00
|
|
|
process::Command,
|
2020-02-14 09:12:49 +01:00
|
|
|
rc::Rc,
|
|
|
|
};
|
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::*;
|