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

Improve std os documentation #2 #14713

Merged
merged 1 commit into from
Jun 12, 2014
Merged

Improve std os documentation #2 #14713

merged 1 commit into from
Jun 12, 2014

Conversation

darnuria
Copy link
Contributor

@darnuria darnuria commented Jun 7, 2014

Improving documentation, consistency, removes evils empty lines etc...

/// ```rust
/// let key = "KEY";
/// let value = "VALEUR";
/// std::os::setenv(key, value);
Copy link
Member

Choose a reason for hiding this comment

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

These two can be written as just os::... with a use std::os; added at the top.

@darnuria
Copy link
Contributor Author

darnuria commented Jun 8, 2014

I rebased this for clarity.
@huonw, @alexcrichton this seems fine? Or need to be polished?

@@ -80,7 +80,7 @@ static BUF_BYTES : uint = 2048u;
///
/// ```rust
/// // We assume that we are in a valid directory like "/home".
/// let current_working_directory = std::os::getcwd();
/// let current_working_directory = os::getcwd();
Copy link
Member

Choose a reason for hiding this comment

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

Does this compile? I think you will need to add use std::os; to the example.

Copy link
Member

Choose a reason for hiding this comment

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

(You can test these by running make check-stage2-doc-crate-std TESTNAME=os. After doing that, you can add the NO_REBUILD=1 flag when rerunning that make invocation, to just run the documentation tests directly, without doing the full bootstrap.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks you so much for the compilation trick you saved my time! ;)

@darnuria
Copy link
Contributor Author

darnuria commented Jun 9, 2014

@alexcrichton : r?

@darnuria
Copy link
Contributor Author

darnuria commented Jun 9, 2014

Thanks for reviews and corrections!

}
})
fn _homedir() -> Option<Path> {
aux_homedir("USERPROFILE")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexcrichton If I change this like to

aux_homedir("USERPROFILE").or(aux_homedir("HOME"))

That will make the job?

Copy link
Member

Choose a reason for hiding this comment

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

The old code has the opposite behavior, favoring HOME over USERPROFILE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your sharp eyes! It's better to express it in this way? Or the old one?

Copy link
Member

Choose a reason for hiding this comment

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

Either way is fine.

@darnuria
Copy link
Contributor Author

@alexcrichton All green !

@darnuria
Copy link
Contributor Author

@alexcrichton r? I think it's the good one. However builds on travis failed but not on my laptop.

bors added a commit that referenced this pull request Jun 12, 2014
… r=alexcrichton

Improving documentation, consistency, removes evils empty lines etc...
@bors bors closed this Jun 12, 2014
@bors bors merged commit 6dc0624 into rust-lang:master Jun 12, 2014
@darnuria
Copy link
Contributor Author

@alexcrichton @huonw: Hurray! Thanks for everything I learned a lot about dealing with review, git stuff. :)

@darnuria darnuria deleted the Improve_std_os_documentation_#2 branch July 5, 2014 21:42
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
…raw-strings, r=Veykril

fix: ide: do not highlight escapes in raw strings

fixes rust-lang#14688
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.

None yet

5 participants