changeset 52310:a876ab6c3fd5

rust: fix `cargo doc` warnings It makes sense to keep our doc build happy, even if it is lacking.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 04 Nov 2024 15:17:54 +0100
parents f69a3f55fa9b
children f7b2806035a7
files rust/hg-core/src/config/config_items.rs rust/hg-core/src/matchers.rs rust/hg-core/src/progress.rs rust/hg-core/src/revlog/index.rs rust/hg-core/src/vfs.rs
diffstat 5 files changed, 20 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/config/config_items.rs	Mon Nov 04 13:43:36 2024 +0100
+++ b/rust/hg-core/src/config/config_items.rs	Mon Nov 04 15:17:54 2024 +0100
@@ -25,9 +25,9 @@
     default: Option<DefaultConfigItemType>,
     /// If the config option is generic (e.g. `merge-tools.*`), defines
     /// the priority of this item relative to other generic items.
-    /// If we're looking for <pattern>, then all generic items within the same
-    /// section will be sorted by order of priority, and the first regex match
-    /// against `name` is returned.
+    /// If we're looking for `<pattern>`, then all generic items within the
+    /// same section will be sorted by order of priority, and the first
+    /// regex match against `name` is returned.
     #[serde(default)]
     priority: Option<isize>,
     /// Aliases, if any. Each alias is a tuple of `(section, name)` for each
--- a/rust/hg-core/src/matchers.rs	Mon Nov 04 13:43:36 2024 +0100
+++ b/rust/hg-core/src/matchers.rs	Mon Nov 04 15:17:54 2024 +0100
@@ -39,7 +39,7 @@
     /// Visit this directory and probably its children
     This,
     /// Only visit the children (both files and directories) if they
-    /// are mentioned in this set. (empty set corresponds to [Empty])
+    /// are mentioned in this set. (empty set corresponds to [`Self::Empty`])
     /// TODO Should we implement a `NonEmptyHashSet`?
     Set(HashSet<HgPathBuf>),
     /// Visit this directory and all subdirectories
--- a/rust/hg-core/src/progress.rs	Mon Nov 04 13:43:36 2024 +0100
+++ b/rust/hg-core/src/progress.rs	Mon Nov 04 15:17:54 2024 +0100
@@ -19,7 +19,7 @@
 
 const PROGRESS_DELAY: Duration = Duration::from_secs(1);
 
-/// A generic (determinate) progress bar. Stays hidden until [`PROGRESS_DELAY`]
+/// A generic (determinate) progress bar. Stays hidden until `PROGRESS_DELAY`
 /// to prevent flickering a progress bar for super fast operations.
 pub struct HgProgressBar {
     progress: ProgressBar,
--- a/rust/hg-core/src/revlog/index.rs	Mon Nov 04 13:43:36 2024 +0100
+++ b/rust/hg-core/src/revlog/index.rs	Mon Nov 04 15:17:54 2024 +0100
@@ -309,7 +309,7 @@
 ///
 /// TODO the dubious part is insisting that errors must be RevlogError
 /// we would probably need to sprinkle some magic here, such as an associated
-/// type that would be Into<RevlogError> but even that would not be
+/// type that would be `Into<RevlogError>` but even that would not be
 /// satisfactory, as errors potentially have nothing to do with the revlog.
 pub trait SnapshotsCache {
     fn insert_for(
--- a/rust/hg-core/src/vfs.rs	Mon Nov 04 13:43:36 2024 +0100
+++ b/rust/hg-core/src/vfs.rs	Mon Nov 04 15:17:54 2024 +0100
@@ -360,33 +360,33 @@
 
 /// Examine whether new stat is ambiguous against old one
 ///
-/// "S[N]" below means stat of a file at N-th change:
+/// `S[N]` below means stat of a file at `N`-th change:
 ///
-/// - S[n-1].ctime  < S[n].ctime: can detect change of a file
-/// - S[n-1].ctime == S[n].ctime
-///   - S[n-1].ctime  < S[n].mtime: means natural advancing (*1)
-///   - S[n-1].ctime == S[n].mtime: is ambiguous (*2)
-///   - S[n-1].ctime  > S[n].mtime: never occurs naturally (don't care)
-/// - S[n-1].ctime  > S[n].ctime: never occurs naturally (don't care)
+/// - `S[n-1].ctime  < S[n].ctime`: can detect change of a file
+/// - `S[n-1].ctime == S[n].ctime`
+///   - `S[n-1].ctime  < S[n].mtime`: means natural advancing (*1)
+///   - `S[n-1].ctime == S[n].mtime`: is ambiguous (*2)
+///   - `S[n-1].ctime  > S[n].mtime`: never occurs naturally (don't care)
+/// - `S[n-1].ctime  > S[n].ctime`: never occurs naturally (don't care)
 ///
 /// Case (*2) above means that a file was changed twice or more at
-/// same time in sec (= S[n-1].ctime), and comparison of timestamp
+/// same time in sec (= `S[n-1].ctime`), and comparison of timestamp
 /// is ambiguous.
 ///
 /// Base idea to avoid such ambiguity is "advance mtime 1 sec, if
 /// timestamp is ambiguous".
 ///
 /// But advancing mtime only in case (*2) doesn't work as
-/// expected, because naturally advanced S[n].mtime in case (*1)
-/// might be equal to manually advanced S[n-1 or earlier].mtime.
+/// expected, because naturally advanced `S[n].mtime` in case (*1)
+/// might be equal to manually advanced `S[n-1 or earlier].mtime`.
 ///
-/// Therefore, all "S[n-1].ctime == S[n].ctime" cases should be
+/// Therefore, all `S[n-1].ctime == S[n].ctime` cases should be
 /// treated as ambiguous regardless of mtime, to avoid overlooking
 /// by confliction between such mtime.
 ///
-/// Advancing mtime "if isambig(new, old)" ensures "S[n-1].mtime !=
-/// S[n].mtime", even if size of a file isn't changed.
-fn is_filetime_ambiguous(new: &Metadata, old: &Metadata) -> bool {
+/// Advancing mtime `if isambig(new, old)` ensures `S[n-1].mtime !=
+/// S[n].mtime`, even if size of a file isn't changed.
+pub fn is_filetime_ambiguous(new: &Metadata, old: &Metadata) -> bool {
     new.ctime() == old.ctime()
 }