Skip to content

Nested Paths in Use Statements #1400

@nixpulvis

Description

@nixpulvis

Use statements are a bit unwieldy from time to time. I find myself wanting to follow some kind of rule for how to do my use statements. One problem is with useing many things from a single crate. For example:

use bincode::SizeLimit;
use bincode::rustc_serialize::{DecodingError, encode, decode};

I think it would be nice to be able to collapse this into a single use statement as follows:

use bincode::{
    SizeLimit,
    rustc_serialize::{
        DecodingError,
        encode,
        decode
    }
};

I know that not everyone will like this example, but the ability to have paths inside of the {, } form of the use statement would be a nice addition in many cases. This feature seemed so intuitive to me I honestly almost expected it to already work like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langRelevant to the language team, which will review and decide on the RFC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions