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

Rename Option in tutorial to workaround iteration bug. #15707

Closed
wants to merge 5 commits into from
Closed

Rename Option in tutorial to workaround iteration bug. #15707

wants to merge 5 commits into from

Conversation

treeman
Copy link
Contributor

@treeman treeman commented Jul 16, 2014

Fix for #15409.

I opted to rename Option to MyOption so we won't get an error if we simply type in all code.

Explicitly mention that rust has an Option type and in the following code snippets we use rust's built in type. It should be clear what's going on I hope.

@alexcrichton
Copy link
Member

cc @steveklabnik

@sinistersnare
Copy link
Contributor

Im not a fan of prefixing My when we can, maybe go Haskell and use Maybe Just Nothing?

enum Maybe<T> {
    Just(T),
    Nothing 
}

@treeman
Copy link
Contributor Author

treeman commented Jul 16, 2014

Point taken. In hindsight, it does look better.

`Stack<int>`, and `Maybe<int>`.

The last type in that example, `Maybe`, is already defined in Rust as
the type `Option` with the constants `Some(T)` and `None`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, maybe it should not be 'constants', but 'variants'

@treeman treeman changed the title Rename Option to MyOption in tutorial to workaround iteration bug. Rename Option in tutorial to workaround iteration bug. Jul 16, 2014
@alexcrichton
Copy link
Member

Closing, this was fixed by #15809

bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 13, 2023
…nfig, r=lnicola

Add configuration for the default action of the status bar click action in VSCode

Fixes rust-lang#15441

Please suggest any changes if necessary.
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

Successfully merging this pull request may close these issues.

3 participants