Skip to content

doc: use of the import should be implied #25629

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
wants to merge 1 commit into from
Closed

doc: use of the import should be implied #25629

wants to merge 1 commit into from

Conversation

tshepang
Copy link
Member

The import is shown on the first example, and that should be enough.
It looks noisy otherwise, especially given the tiny examples.

@rust-highfive
Copy link
Contributor

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@Gankra
Copy link
Contributor

Gankra commented May 20, 2015

r? @steveklabnik

I'm not familiar with this as a convention, but I think it's a good idea. Not willing to make a call on it, personally.

@rust-highfive rust-highfive assigned steveklabnik and unassigned huonw May 20, 2015
@steveklabnik
Copy link
Member

I actually prefer for this stuff to be shown as much as possible, honestly. Lots of people copy/paste/run, and then it doesn't work.

@tshepang
Copy link
Member Author

I see this approach a lot in Python documentation.

BTW, we don't display the fn main() {} noise as well.

The copy/pasting thing is easily fixed by good error messages :)

@bors
Copy link
Collaborator

bors commented May 24, 2015

☔ The latest upstream changes (presumably #25666) made this pull request unmergeable. Please resolve the merge conflicts.

@tshepang
Copy link
Member Author

Maybe if I add a note that use std::path::Path (or std::path::PathBuf) is implied, this will be more acceptable?

@steveklabnik
Copy link
Member

I think that this deserves a discussion on what the official style is before it gets merged. As such, let's close this for now. @tshepang , maybe write up a small RFC?

@tshepang
Copy link
Member Author

tshepang commented Jun 8, 2015

good idea, especially because displaying use foo is all over the place

@tshepang
Copy link
Member Author

tshepang commented Jun 8, 2015

discussion

@tshepang tshepang deleted the noisy-imports branch June 18, 2015 21:57
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.

6 participants