Skip to content

rustfmt gets upset when trying to format a let-else block inside a macro. #5760

Closed as not planned
@vincenzopalazzo

Description

@vincenzopalazzo

This what rustfmt produces when I run the code formatting

#[macro_export]
macro_rules! from_cstr {
    ($x:expr) => {{
        use std::ffi::CStr;
        let c_str = unsafe { CStr::from_ptr($x) };
        let Ok(c_str) = c_str.to_str() else {
                                                                                    return null!()
                                                                                };
        c_str
    }};
}

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