Skip to content
This repository was archived by the owner on Sep 14, 2023. It is now read-only.
This repository was archived by the owner on Sep 14, 2023. It is now read-only.

Panic on duplicates in the options section #228

@xTibor

Description

@xTibor

I encountered this panic with 0.8.1 from crates.io and rustc 1.21.0-nightly.

Here's a minimal test case of the problem:

Test program

extern crate docopt;

use docopt::Docopt;

const USAGE: &'static str = "Test
Usage:
  test

Options:
  -h --help
  -h
";

fn main() {
    let x = Docopt::new(USAGE);
}

Panic

`thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /checkout/src/libcore/option.rs:335:20`

Backtrace: https://gist.github.com/xTibor/b596b3f69d1c28d71c74221ea5a98c6b

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions