11use {
22 self :: {
3- arguments:: Arguments , bytes:: Bytes , display_path:: DisplayPath , display_secret:: DisplaySecret ,
4- entry:: Entry , error:: Error , hash:: Hash , into_u64:: IntoU64 , lint:: Lint , lint_group:: LintGroup ,
5- list:: List , manifest:: Manifest , metadata:: Metadata , options:: Options ,
6- owo_colorize_ext:: OwoColorizeExt , page:: Page , private_key:: PrivateKey , public_key:: PublicKey ,
7- relative_path:: RelativePath , signature:: Signature , signature_error:: SignatureError ,
8- style:: Style , subcommand:: Subcommand , template:: Template , utf8_path_ext:: Utf8PathExt ,
3+ archive:: Archive , archive_error:: ArchiveError , arguments:: Arguments , bytes:: Bytes ,
4+ display_path:: DisplayPath , display_secret:: DisplaySecret , entry:: Entry , error:: Error ,
5+ hash:: Hash , into_u64:: IntoU64 , lint:: Lint , lint_group:: LintGroup , list:: List ,
6+ manifest:: Manifest , metadata:: Metadata , options:: Options , owo_colorize_ext:: OwoColorizeExt ,
7+ page:: Page , private_key:: PrivateKey , public_key:: PublicKey , relative_path:: RelativePath ,
8+ signature:: Signature , signature_error:: SignatureError , style:: Style , subcommand:: Subcommand ,
9+ template:: Template , utf8_path_ext:: Utf8PathExt ,
910 } ,
1011 blake3:: Hasher ,
1112 boilerplate:: Boilerplate ,
1718 owo_colors:: Styled ,
1819 serde:: { Deserialize , Deserializer , Serialize , Serializer } ,
1920 serde_with:: { DeserializeFromStr , SerializeDisplay } ,
20- snafu:: { ensure, ErrorCompat , OptionExt , ResultExt , Snafu } ,
21+ snafu:: { ensure, ErrorCompat , IntoError , OptionExt , ResultExt , Snafu } ,
2122 std:: {
2223 array:: TryFromSliceError ,
2324 backtrace:: { Backtrace , BacktraceStatus } ,
@@ -26,17 +27,38 @@ use {
2627 env,
2728 fmt:: { self , Display , Formatter } ,
2829 fs:: { self , File } ,
29- io:: { self , BufWriter , IsTerminal , Write } ,
30+ io:: { self , BufReader , BufWriter , IsTerminal , Read , Write } ,
3031 path:: { Path , PathBuf } ,
3132 process,
3233 str:: { self , FromStr } ,
34+ sync:: Arc ,
3335 } ,
36+ tokio:: runtime:: Runtime ,
3437 walkdir:: WalkDir ,
3538} ;
3639
3740#[ cfg( test) ]
38- use assert_fs:: TempDir ;
41+ use assert_fs:: {
42+ fixture:: { FileWriteBin , PathChild } ,
43+ TempDir ,
44+ } ;
45+
46+ #[ cfg( test) ]
47+ macro_rules! assert_matches {
48+ ( $expression: expr, $( $pattern: pat_param ) |+ $( if $guard: expr ) ? $( , ) ?) => {
49+ match $expression {
50+ $( $pattern ) |+ $( if $guard ) ? => { }
51+ left => panic!(
52+ "assertion failed: (left ~= right)\n left: `{:?}`\n right: `{}`" ,
53+ left,
54+ stringify!( $( $pattern) |+ $( if $guard) ?)
55+ ) ,
56+ }
57+ }
58+ }
3959
60+ mod archive;
61+ mod archive_error;
4062mod arguments;
4163mod bytes;
4264mod display_path;
@@ -75,6 +97,10 @@ fn current_dir() -> Result<Utf8PathBuf> {
7597 . map_err ( |path| error:: PathUnicode { path } . build ( ) )
7698}
7799
100+ fn decode_path ( path : & Path ) -> Result < & Utf8Path > {
101+ Utf8Path :: from_path ( path) . context ( error:: PathUnicode { path } )
102+ }
103+
78104fn main ( ) {
79105 if let Err ( err) = Arguments :: parse ( ) . run ( ) {
80106 let style = Style :: stderr ( ) ;
0 commit comments