We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling tar03 v0.1.0 (/Users/marc47/rust/tar03) error[E0107]: this enum takes 2 generic arguments but 1 generic argument was supplied --> src/main.rs:8:14 | 8 | fn main() -> Result<()> { | ^^^^^^ -- supplied 1 generic argument | | | expected 2 generic arguments | note: enum defined here, with 2 generic parameters: T, E --> /Users/marc47/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/result.rs:503:10 | 503 | pub enum Result<T, E> { | ^^^^^^ - - help: add missing generic argument | 8 | fn main() -> Result<(), E> { | +++
T
E
For more information about this error, try rustc --explain E0107. error: could not compile tar03 due to previous error
rustc --explain E0107
tar03
The text was updated successfully, but these errors were encountered:
use flate2::read::GzDecoder; use std::fs::File; use std::path::PathBuf; use tar::Archive;
type Result = std::result::Result<T, std::io::Error>; // i add this line to solve this issue
fn main() -> Result<()> { let file = File::open("archive.tar.gz")?; let mut archive = Archive::new(GzDecoder::new(file)); let prefix = "bundle/logs";
println!("Extracted the following files:"); archive .entries()? .filter_map(|e| e.ok()) .map(|mut entry| -> Result<PathBuf> { let path = entry.path()?.strip_prefix(prefix).unwrap().to_owned(); entry.unpack(&path)?; Ok(path) }) .filter_map(|e| e.ok()) .for_each(|x| println!("> {}", x.display())); Ok(())
}
Sorry, something went wrong.
Result
Successfully merging a pull request may close this issue.
Compiling tar03 v0.1.0 (/Users/marc47/rust/tar03)
error[E0107]: this enum takes 2 generic arguments but 1 generic argument was supplied
--> src/main.rs:8:14
|
8 | fn main() -> Result<()> {
| ^^^^^^ -- supplied 1 generic argument
| |
| expected 2 generic arguments
|
note: enum defined here, with 2 generic parameters:
T
,E
--> /Users/marc47/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/result.rs:503:10
|
503 | pub enum Result<T, E> {
| ^^^^^^ - -
help: add missing generic argument
|
8 | fn main() -> Result<(), E> {
| +++
For more information about this error, try
rustc --explain E0107
.error: could not compile
tar03
due to previous errorThe text was updated successfully, but these errors were encountered: