File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
frontend-utils/src/bundle Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 1+ use :: zip:: result:: ZipError ;
2+
13use crate :: bundle:: info:: BUNDLE_INFORMATION_FILENAME ;
24use crate :: bundle:: source:: zip:: ZipSource ;
35use std:: ffi:: OsStr ;
@@ -31,8 +33,8 @@ pub enum BundleSourceError {
3133 #[ error( "Unknown bundle source" ) ]
3234 UnknownSource ,
3335
34- #[ error( "Invalid or corrupt zip " ) ]
35- InvalidZip ,
36+ #[ error( "Invalid or corrupt archive: {0} " ) ]
37+ InvalidArchive ( # [ from ] ZipError ) ,
3638
3739 #[ error( "IO error opening file: {0}" ) ]
3840 Io ( #[ from] Error ) ,
@@ -65,11 +67,8 @@ impl BundleSource {
6567 }
6668
6769 pub fn from_reader < R : Read + Seek + ' static > ( reader : R ) -> Result < Self , BundleSourceError > {
68- return if let Ok ( zip) = ZipSource :: < Box < dyn BundleSourceData > > :: open ( Box :: new ( reader) ) {
69- Ok ( Self :: ZipFile ( zip) )
70- } else {
71- Err ( BundleSourceError :: InvalidZip )
72- } ;
70+ let zip_source = ZipSource :: < Box < dyn BundleSourceData > > :: open ( Box :: new ( reader) ) ?;
71+ Ok ( Self :: ZipFile ( zip_source) )
7372 }
7473
7574 /// Reads any file from the bundle.
You can’t perform that action at this time.
0 commit comments