mlvzk / manix

A fast CLI documentation searcher for Nix.
Mozilla Public License 2.0
348 stars 19 forks source link

`manix list` leads to error #8

Closed DavHau closed 4 years ago

DavHau commented 4 years ago
$ RUST_BACKTRACE=1 manix list
# listDfs (lib/lists.nix)
 Depth-First Search (DFS) for lists `list != []`.

     `before a b == true` means that `b` depends on `a` (there's an
     edge from `b` to `a`).

     Example:
         listDfs true hasPrefix [ "/home/user" "other" "/" "/home" ]
           == { minimal = "/";                  # minimal element
                visited = [ "/home/user" ];     # seen elements (in reverse order)
                rest    = [ "/home" "other" ];  # everything else
              }

         listDfs true hasPrefix [ "/home/user" "other" "/" "/home" "/" ]
           == { cycle   = "/";                  # cycle encountered at this element
                loops   = [ "/" ];              # and continues to these elements
                visited = [ "/" "/home/user" ]; # elements leading to the cycle (in reverse order)
                rest    = [ "/home" "other" ];  # everything else

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: StripPrefixError(())', src/libcore/result.rs:1188:5
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: std::panicking::rust_panic_with_hook
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::result::unwrap_failed
   9: manix::comments_docsource::CommentDocumentation::pretty_printed
  10: manix::DocEntry::pretty_printed
  11: manix::main
  12: std::rt::lang_start::{{closure}}
  13: std::panicking::try::do_call
  14: __rust_maybe_catch_panic
  15: std::rt::lang_start_internal
  16: main
  17: __libc_start_main
  18: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
mlvzk commented 4 years ago

Strange. Could you try the branch fix-strip-unwrap?

mlvzk commented 4 years ago

I merged the change to master. Please comment if the issue still persists.

DavHau commented 4 years ago

Now it works, thanks.