Skip to content

Instantly share code, notes, and snippets.

@pvanheus
Created January 7, 2019 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pvanheus/c98676d1b83ad804048c2900e517140c to your computer and use it in GitHub Desktop.
Save pvanheus/c98676d1b83ad804048c2900e517140c to your computer and use it in GitHub Desktop.
let output_file = match matches.value_of("OUTPUT_FILE") {
Some(name) => fasta::Writer::new(File::create(name).expect(format!("Failed to open output file ({})", name).as_str())),
None => fasta::Writer::new(io::stdout())
};
//
// error[E0308]: match arms have incompatible types
// --> src/main.rs:42:23
// |
// 42 | let output_file = match matches.value_of("OUTPUT_FILE") {
// | _______________________^
// 43 | | Some(name) => fasta::Writer::new(File::create(name).expect(format!("Failed to open output file ({})", name).as_str())),
// 44 | | None => fasta::Writer::new(io::stdout())
// | | -------------------------------- match arm with an incompatible type
// 45 | | };
// | |_____^ expected struct `std::fs::File`, found struct `std::io::Stdout`
// |
// = note: expected type `bio::io::fasta::Writer<std::fs::File>`
// found type `bio::io::fasta::Writer<std::io::Stdout>`
//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment