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

add missing docs for MetadataExt #45470

Merged
merged 1 commit into from
Nov 7, 2017

Conversation

GuillaumeGomez
Copy link
Member

r? @rust-lang/docs

@kennytm kennytm added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 23, 2017
///
/// # Examples
///
/// ```
Copy link
Member

Choose a reason for hiding this comment

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

no_run?

/// # Examples
///
/// ```
/// # #[cfg(target_os = "linux")] {
Copy link
Member

Choose a reason for hiding this comment

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

This is in the unix module, not linux, so it would be more accurate to use cfg(unix) here. (I would prefer not having this wrapper here at all, but if you're going to keep it then that's my suggestion.)

/// let user_has_write_access = mode & 0200;
/// let user_has_read_write_access = mode & 0600;
/// let group_has_read_access = mode & 0040;
/// let others_have_exec_access = mode & 0001;
Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure these should all be 0o200 etc? I didn't think rust had zero-prefix octal notation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh damn you're right! Bad assumption. :s

@GuillaumeGomez
Copy link
Member Author

Updated.

Copy link
Member

@QuietMisdreavus QuietMisdreavus left a comment

Choose a reason for hiding this comment

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

Sorry for letting this get stale! I have a couple more nits. You can take them or leave them.

#[stable(feature = "metadata_ext", since = "1.1.0")]
fn blksize(&self) -> u64;
/// Returns the number of 512 bytes blocks allocated.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe "the number of blocks allocated to the file, in 512-byte units"? (This is what man 2 stat says on my system. It also has an additional "This may be smaller than st_size/512 when the file has holes," which may also be worth including.)

///
/// ```no_run
/// use std::fs;
/// use std::os::unix::prelude::MetadataExt;
Copy link
Member

Choose a reason for hiding this comment

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

I feel like it would be better to grab the trait in its actual home of std::os::unix::fs::MetadataExt, rather than pulling from the unix prelude? Since that's the page that these examples will be living on. >_>

@kennytm kennytm added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 30, 2017
@GuillaumeGomez
Copy link
Member Author

Updated.

@kennytm kennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 2, 2017
@carols10cents
Copy link
Member

r? @QuietMisdreavus

@QuietMisdreavus
Copy link
Member

@bors r+ rollup

Thanks!

@bors
Copy link
Contributor

bors commented Nov 6, 2017

📌 Commit af1e4f6 has been approved by QuietMisdreavus

@kennytm kennytm added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 7, 2017
kennytm added a commit to kennytm/rust that referenced this pull request Nov 7, 2017
…=QuietMisdreavus

add missing docs for MetadataExt

r? @rust-lang/docs
kennytm added a commit to kennytm/rust that referenced this pull request Nov 7, 2017
…=QuietMisdreavus

add missing docs for MetadataExt

r? @rust-lang/docs
bors added a commit that referenced this pull request Nov 7, 2017
Rollup of 9 pull requests

- Successful merges: #45470, #45588, #45682, #45714, #45751, #45764, #45778, #45782, #45784
- Failed merges:
@bors bors merged commit af1e4f6 into rust-lang:master Nov 7, 2017
@GuillaumeGomez GuillaumeGomez deleted the unix-metadata-ext branch November 7, 2017 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants