Skip to content

Commit

Permalink
Rollup merge of rust-lang#61202 - oberien:permissionext-print-octal, …
Browse files Browse the repository at this point in the history
…r=varkor

Print PermissionExt::mode() in octal in Documentation Examples

Printing the file permission mode on unix systems in decimal feels unintuitive. Printing it in octal gives the expected form of e.g. `664`.
  • Loading branch information
Centril authored May 28, 2019
2 parents dae331d + 04e45c8 commit 21684c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libstd/sys/redox/ext/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub trait PermissionsExt {
/// let metadata = f.metadata()?;
/// let permissions = metadata.permissions();
///
/// println!("permissions: {}", permissions.mode());
/// println!("permissions: {:o}", permissions.mode());
/// Ok(())
/// }
/// ```
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/unix/ext/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ pub trait PermissionsExt {
/// let metadata = f.metadata()?;
/// let permissions = metadata.permissions();
///
/// println!("permissions: {}", permissions.mode());
/// println!("permissions: {:o}", permissions.mode());
/// Ok(()) }
/// ```
#[stable(feature = "fs_ext", since = "1.1.0")]
Expand Down

0 comments on commit 21684c0

Please sign in to comment.