Skip to content

update doc for Rust edition 2018 not requiring 'extern crate'  #30

@jmegner

Description

@jmegner

As a newcomer to Rust, I was mislead by the crate doc example code into thinking that #[macro_use] extern crate maplit; was needed to use maplit's macros. I was using Rust edition 2018 and use maplit::{hashmap, btreeset}; was actually what I needed.

Is there some way to have the doc state what is needed for Rust edition 2015 and what is needed for Rust edition 2018? If it doesn't offend your sense of aesthetics, something as simple as the following would have been great for someone like me who was unaware of Rust edition 2018 removing almost all need for usage of extern crate:

#[macro_use] extern crate maplit; // only for Rust edition 2015
use maplit::hashmap; // for Rust edition 2018

Many thanks for your wonderful crate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions