-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
This is how the examples currently recommend formatting Config::load_or_default():
Config::load_or_default(CONFIG_INI, || {
return sectioned_defaults! {
// ...
};
})Clippy recommends removing the unneeded return statement. Doing so, however, leads to errors because sectioned_defaults! and general_defaults! don't return anything. The only other option that isn't flagged by Clippy is formatting the closure this way:
Config::load_or_default(CONFIG_INI, || sectioned_defaults! {
// ...
})However, running cargo fmt changes it to this:
// Does not compile
Config::load_or_default(CONFIG_INI, || {
sectioned_defaults! {
// ...
}
})This adds curly braces around the macro and breaks the function execution immediately.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working