killercup / quicli

Quickly build cool CLI apps in Rust.
https://killercup.github.io/quicli/
Apache License 2.0
540 stars 31 forks source link

issue in 'getting started' #101

Closed chrispickard closed 5 years ago

chrispickard commented 5 years ago

as I was going through the getting started tutorial I noticed that the very last block of code doesn't quite work. It says

~/dev/rust/head
❯ cargo run
   Compiling head v0.1.0 (/home/chris.pickard/dev/rust/head)
error[E0308]: mismatched types
  --> src/main.rs:20:24
   |
20 |   fn main() -> CliResult {
   |  ________________________^
21 | |     let args = Cli::from_args();
22 | |
23 | |     read_file(&args.file)?
...  |
26 | |         .for_each(|line| println!("{}", line));
27 | | }
   | |_^ expected enum `std::result::Result`, found ()
   |
   = note: expected type `std::result::Result<(), exitfailure::ExitFailure>`
              found type `()`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
error: Could not compile `head`.

To learn more, run the command again with --verbose.
killercup commented 5 years ago

Ohhh! Thanks so much for finding this -- it's the only block of code that is not tested! Will fix in a minute!

(You need to add a line with Ok(()) as in the function right above it)

chrispickard commented 5 years ago

awesome thanks for the help