Robzz / cargo-docset

Cargo subcommand to generate a Dash/Zeal docset for your Rust packages.
Apache License 2.0
100 stars 4 forks source link

Unwrap error when running hyphenated cargo-docset #11

Closed ogham closed 5 years ago

ogham commented 5 years ago

Describe the bug

I got confused, and ran cargo-docset (with a hyphen) rather than cargo docset (two separate words). It didn't like this very much!

After realising that I needed to run cargo, it all worked fine. I installed it with cargo install cargo-docset just now.

Screenshots

$ cargo docset
Cargo configuration error: could not find `Cargo.toml` in `/Users/ben` or any parent directory

$ cargo-docset
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:378:21
stack backtrace:
   0: std::panicking::default_hook::{{closure}}
   1: std::panicking::default_hook
   2: std::panicking::rust_panic_with_hook
   3: std::panicking::continue_panic_fmt
   4: rust_begin_unwind
   5: core::panicking::panic_fmt
   6: core::panicking::panic
   7: cargo_docset::main
   8: std::rt::lang_start::{{closure}}
   9: std::panicking::try::do_call
  10: __rust_maybe_catch_panic
  11: std::rt::lang_start_internal
  12: main

Desktop (please complete the following information):

Robzz commented 5 years ago

Thanks for the report, I can reproduce this, so this should be a pretty easy fix.