Could not find `Options` in` getopts`

I am trying to use a structure Optionsin a box getoptsthat exists according to the Rust book.

The code I'm running is this.

let mut opts = getopts::Options::new();

When creating a project, the compiler generates an error

 let mut opts = getopts::Options::new();
                ^^^^^^^^^^^^^^^^^^^^^ Could not find `Options in `getopts`

How do i solve this? I am using the nightly version of Rust.

+4
source share
1 answer

Instead, you need to use crates.io version . You can see here that the embedded version has getoptsbeen flagged as an internal compiler with rustc_private. The version on crates.io is basically the same box. The internal version of the compiler is simply split for various reasons.

+4
source

Source: https://habr.com/ru/post/1673874/


All Articles