Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default T=() to rune::Result #598

Closed
ModProg opened this issue Aug 7, 2023 · 1 comment
Closed

Add default T=() to rune::Result #598

ModProg opened this issue Aug 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ModProg
Copy link
Contributor

ModProg commented Aug 7, 2023

Allows to do:

type Result<T = (), E = anyhow::Error> = core::result::Result<T, E>;

fn some_test -> Result {
    Ok(())
}

Though I also get not doing this, you really don't save much, but not having to say Result<()>.

@udoprog udoprog added the enhancement New feature or request label Aug 7, 2023
@udoprog
Copy link
Collaborator

udoprog commented Aug 7, 2023

Might be a bit too unusual for my taste.

Strongest precedent I can think of is std::fmt::Result, but then it's set to exactly value. Even there it's a bit odd. 🤔

@udoprog udoprog closed this as completed Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants