Skip to content

Change unwrap()s to expect()s in module.rs #90

Closed
@ojeda

Description

@ojeda

Although we don't get output unless we use -Z proc-macro-backtrace, it is a good idea to provide some more details like we do for some of the others, e.g. in:

fn expect_punct(it: &mut token_stream::IntoIter) -> char {
    if let TokenTree::Punct(punct) = it.next().unwrap() {
    ...

This unwrap() may fail if we find the end of the stream unexpectedly (because the user didn't pass the arguments that we expected).

Metadata

Metadata

Assignees

No one assigned

    Labels

    • libRelated to the `rust/` library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions