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

use self instead of mod in import statements #19906

Closed
liigo opened this issue Dec 16, 2014 · 6 comments
Closed

use self instead of mod in import statements #19906

liigo opened this issue Dec 16, 2014 · 6 comments

Comments

@liigo
Copy link
Contributor

liigo commented Dec 16, 2014

After enum variants was name-spaced,
use Option::{mod, Some, None};
looks weird, because Option is NOT a module.
change mod to self would be more clear:
use Option::{self, Some, None};
use std::option::{self, Option};

@lifthrasiir
Copy link
Contributor

Note that self also has a role of indicating a relative path so there is a possibility of confusion. Maybe an RFC material.

@tomjakubowski
Copy link
Contributor

use Option::{enum, ..} is an alternative that seems more consistent with mod to me.

@liigo
Copy link
Contributor Author

liigo commented Dec 19, 2014

Normally self only appears at the front of a path, to indicate a relative path, maybe I'm wrong?
enum is good, too. self maybe better, for its generic.

@reem
Copy link
Contributor

reem commented Dec 19, 2014

Just noting that this change would require an RFC.

@lifthrasiir
Copy link
Contributor

I've written a simple RFC for this issue: rust-lang/rfcs#532.

@liigo
Copy link
Contributor Author

liigo commented Dec 19, 2014

closing in favor of RFC PR 532. thank you @lifthrasiir !

@liigo liigo closed this as completed Dec 19, 2014
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

4 participants