Skip to content

Commit 7f9c0a9

Browse files
committed
More comment tidying.
1 parent 468af88 commit 7f9c0a9

27 files changed

+104
-78
lines changed

cap-async-std/src/fs/dir.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,9 +566,10 @@ impl Dir {
566566

567567
/// Checks if `path` is a directory.
568568
///
569-
/// This is similar to [`async_std::path::Path::is_dir`] in that it checks if `path` relative to
570-
/// `Dir` is a directory. This function will traverse symbolic links to query information about
571-
/// the destination file. In case of broken symbolic links, this will return `false`.
569+
/// This is similar to [`async_std::path::Path::is_dir`] in that it checks
570+
/// if `path` relative to `Dir` is a directory. This function will traverse
571+
/// symbolic links to query information about the destination file. In case
572+
/// of broken symbolic links, this will return `false`.
572573
#[inline]
573574
pub fn is_dir<P: AsRef<Path>>(&self, path: P) -> bool {
574575
self.metadata(path).map(|m| m.is_dir()).unwrap_or(false)

cap-async-std/src/fs/dir_entry.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ impl DirEntry {
7777
self.inner.file_type()
7878
}
7979

80-
/// Returns the bare file name of this directory entry without any other leading path component.
80+
/// Returns the bare file name of this directory entry without any other
81+
/// leading path component.
8182
///
8283
/// This corresponds to [`async_std::fs::DirEntry::file_name`].
8384
#[inline]

cap-async-std/src/fs_utf8/dir.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,10 @@ impl Dir {
477477

478478
/// Checks if `path` is a directory.
479479
///
480-
/// This is similar to [`async_std::path::Path::is_dir`] in that it checks if `path` relative to
481-
/// `Dir` is a directory. This function will traverse symbolic links to query information about
482-
/// the destination file. In case of broken symbolic links, this will return `false`.
480+
/// This is similar to [`async_std::path::Path::is_dir`] in that it checks
481+
/// if `path` relative to `Dir` is a directory. This function will traverse
482+
/// symbolic links to query information about the destination file. In case
483+
/// of broken symbolic links, this will return `false`.
483484
#[inline]
484485
pub fn is_dir<P: AsRef<str>>(&self, path: P) -> bool {
485486
match from_utf8(path) {

cap-async-std/src/fs_utf8/dir_entry.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ impl DirEntry {
8080
self.cap_std.file_type().await
8181
}
8282

83-
/// Returns the bare file name of this directory entry without any other leading path component.
83+
/// Returns the bare file name of this directory entry without any other
84+
/// leading path component.
8485
///
8586
/// This corresponds to [`async_std::fs::DirEntry::file_name`].
8687
#[inline]

cap-fs-ext/src/open_options_follow_ext.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ impl OpenOptionsFollowExt for cap_primitives::fs::OpenOptions {
1717
#[inline]
1818
fn follow(&mut self, follow: FollowSymlinks) -> &mut Self {
1919
// `follow` functionality is implemented within `cap_primitives`; we're
20-
// just exposing it here since `OpenOptions` is re-exported by `cap_std`
21-
// etc. and `follow` isn't in `std`.
20+
// just exposing it here since `OpenOptions` is re-exported by
21+
// `cap_std` etc. and `follow` isn't in `std`.
2222
unsafe { self._cap_fs_ext_follow(follow) }
2323
}
2424
}

cap-fs-ext/src/open_options_maybe_dir_ext.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ pub trait OpenOptionsMaybeDirExt {
1212
impl OpenOptionsMaybeDirExt for cap_primitives::fs::OpenOptions {
1313
#[inline]
1414
fn maybe_dir(&mut self, maybe_dir: bool) -> &mut Self {
15-
// `maybe_dir` functionality is implemented within `cap_primitives`; we're
16-
// just exposing it here since `OpenOptions` is re-exported by `cap_std`
17-
// etc. and `maybe_dir` isn't in `std`.
15+
// `maybe_dir` functionality is implemented within `cap_primitives`;
16+
// we're just exposing it here since `OpenOptions` is re-exported by
17+
// `cap_std` etc. and `maybe_dir` isn't in `std`.
1818
unsafe { self._cap_fs_ext_maybe_dir(maybe_dir) }
1919
}
2020
}

cap-primitives/src/fs/dir_builder.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ use std::fmt;
99
/// creating directories requires a capability. Use [`Dir::create_dir_with`]
1010
/// instead.
1111
///
12-
/// [`Dir::create_dir_with`]: https://doc.rust-lang.org/std/fs/struct.Dir.html#method.create_dir_with
12+
/// [`Dir::create_dir_with`]: https://docs.rs/cap-std/latest/cap_std/fs/struct.Dir.html#method.create_dir_with
1313
///
1414
/// <details>
15-
/// We need to define our own version because the libstd `DirBuilder` doesn't have
16-
/// public accessors that we can use.
15+
/// We need to define our own version because the libstd `DirBuilder` doesn't
16+
/// have public accessors that we can use.
1717
/// </details>
1818
pub struct DirBuilder {
1919
pub(crate) recursive: bool,
2020
pub(crate) options: DirOptions,
2121
}
2222

2323
impl DirBuilder {
24-
/// Creates a new set of options with default mode/security settings for all platforms and also
25-
/// non-recursive.
24+
/// Creates a new set of options with default mode/security settings for
25+
/// all platforms and also non-recursive.
2626
///
2727
/// This corresponds to [`std::fs::DirBuilder::new`].
2828
#[allow(clippy::new_without_default)]

cap-primitives/src/fs/dir_entry.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ impl DirEntry {
8787
self.inner.file_type()
8888
}
8989

90-
/// Returns the bare file name of this directory entry without any other leading path component.
90+
/// Returns the bare file name of this directory entry without any other
91+
/// leading path component.
9192
///
9293
/// This corresponds to [`std::fs::DirEntry::file_name`].
9394
#[inline]

cap-primitives/src/fs/manually/canonical_path.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ impl<'path_buf> CanonicalPath<'path_buf> {
4747
/// The complete canonical path has been scanned. Set `path` to `None`
4848
/// so that it isn't cleared when `self` is dropped.
4949
pub(super) fn complete(&mut self) {
50-
// Replace "" with ".", since "" as a relative path is interpreted as an error.
50+
// Replace "" with ".", since "" as a relative path is interpreted as
51+
// an error.
5152
if let Some(path) = &mut self.path {
5253
if path.as_os_str().is_empty() {
5354
path.push(Component::CurDir);
@@ -60,9 +61,9 @@ impl<'path_buf> CanonicalPath<'path_buf> {
6061
impl<'path_buf> Drop for CanonicalPath<'path_buf> {
6162
fn drop(&mut self) {
6263
// If `self.path` is still `Some` here, it means that we haven't called
63-
// `complete()` yet, meaning the `CanonicalPath` is being dropped before
64-
// the complete path has been processed. In that case, clear `path` to
65-
// indicate that we weren't able to obtain a complete path.
64+
// `complete()` yet, meaning the `CanonicalPath` is being dropped
65+
// before the complete path has been processed. In that case, clear
66+
// `path` to indicate that we weren't able to obtain a complete path.
6667
if let Some(path) = &mut self.path {
6768
path.clear();
6869
self.path = None;

cap-primitives/src/fs/manually/canonicalize.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ use std::{
88
path::{Path, PathBuf},
99
};
1010

11-
/// Implement `canonicalize` by breaking up the path into components and resolving
12-
/// each component individually, and resolving symbolic links manually.
11+
/// Implement `canonicalize` by breaking up the path into components and
12+
/// resolving each component individually, and resolving symbolic links
13+
/// manually.
1314
pub(crate) fn canonicalize(start: &fs::File, path: &Path) -> io::Result<PathBuf> {
1415
canonicalize_with(start, path, FollowSymlinks::Yes)
1516
}
1617

17-
/// The main body of `canonicalize`, which takes an extra `follow` flag allowing
18-
/// the caller to disable following symlinks in the last component.
18+
/// The main body of `canonicalize`, which takes an extra `follow` flag
19+
/// allowing the caller to disable following symlinks in the last component.
1920
pub(crate) fn canonicalize_with(
2021
start: &fs::File,
2122
path: &Path,

0 commit comments

Comments
 (0)