@@ -10,7 +10,7 @@ use crate::*;
1010///
1111/// - `Result<Vec<Package>, PublishError>`: List of packages or error
1212fn discover_packages ( workspace_root : & Path ) -> Result < Vec < Package > , PublishError > {
13- let content: String = read_to_string ( workspace_root) . map_err ( |_| PublishError :: IoError ) ?;
13+ let content: String = read_to_string ( workspace_root) ?;
1414 let doc: toml:: Value =
1515 toml:: from_str ( & content) . map_err ( |_| PublishError :: ManifestParseError ) ?;
1616 let mut packages: Vec < Package > = Vec :: new ( ) ;
@@ -51,8 +51,8 @@ fn expand_pattern(
5151 let parent: & Path = Path :: new ( pattern) . parent ( ) . unwrap_or ( Path :: new ( "." ) ) ;
5252 let full_parent: PathBuf = base_path. join ( parent) ;
5353 if full_parent. is_dir ( ) {
54- for entry in std:: fs:: read_dir ( & full_parent) . map_err ( |_| PublishError :: IoError ) ? {
55- let entry: std:: fs:: DirEntry = entry. map_err ( |_| PublishError :: IoError ) ?;
54+ for entry in std:: fs:: read_dir ( & full_parent) ? {
55+ let entry: std:: fs:: DirEntry = entry?;
5656 let path: PathBuf = entry. path ( ) ;
5757 if path. is_dir ( ) {
5858 let cargo_toml: PathBuf = path. join ( "Cargo.toml" ) ;
@@ -96,7 +96,7 @@ fn read_single_package(manifest_path: &Path) -> Result<Package, PublishError> {
9696///
9797/// - `Result<Package, PublishError>`: Package info or error
9898fn read_package_manifest ( manifest_path : & Path ) -> Result < Package , PublishError > {
99- let content: String = read_to_string ( manifest_path) . map_err ( |_| PublishError :: IoError ) ?;
99+ let content: String = read_to_string ( manifest_path) ?;
100100 let doc: toml:: Value =
101101 toml:: from_str ( & content) . map_err ( |_| PublishError :: ManifestParseError ) ?;
102102 let package_table: & toml:: Value = doc. get ( "package" ) . ok_or ( PublishError :: ManifestParseError ) ?;
0 commit comments