Skip to content

mention the possibility of using enum constructors as functions in expressions #25850

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

Closed
nliberg opened this issue May 28, 2015 · 2 comments
Closed

Comments

@nliberg
Copy link
Contributor

nliberg commented May 28, 2015

Neither the nightly Rust reference nor the book seem to mention the fact that one can use enum constructors in a function like way inside expressions, eg. my_iterator.map(Option::Some).

(unless I'm mistaken and it's there somewhere, but I didn't find it)

@steveklabnik
Copy link
Member

It's maybe obliquely mentioned at best.

@steveklabnik steveklabnik changed the title Rustdoc: mention the possibility of using enum constructors as functions in expressions mention the possibility of using enum constructors as functions in expressions May 29, 2015
@shepmaster
Copy link
Member

IMO, this is two parts:

  1. stating that enum constructors are functions.
  2. stating that functions can be used where Fn* traits are.

I don't know how much you need to go into every permutation of every feature in Rust ^_^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants