# HG changeset patch # User Raphaël Gomès # Date 1730729874 -3600 # Node ID a876ab6c3fd58edc1ba59a42965fa4768231f1e3 # Parent f69a3f55fa9b8dc98dc28a7b97c7993834b54afe rust: fix `cargo doc` warnings It makes sense to keep our doc build happy, even if it is lacking. diff -r f69a3f55fa9b -r a876ab6c3fd5 rust/hg-core/src/config/config_items.rs --- 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, /// 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 , 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 ``, 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, /// Aliases, if any. Each alias is a tuple of `(section, name)` for each diff -r f69a3f55fa9b -r a876ab6c3fd5 rust/hg-core/src/matchers.rs --- 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), /// Visit this directory and all subdirectories diff -r f69a3f55fa9b -r a876ab6c3fd5 rust/hg-core/src/progress.rs --- 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, diff -r f69a3f55fa9b -r a876ab6c3fd5 rust/hg-core/src/revlog/index.rs --- 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 but even that would not be +/// type that would be `Into` but even that would not be /// satisfactory, as errors potentially have nothing to do with the revlog. pub trait SnapshotsCache { fn insert_for( diff -r f69a3f55fa9b -r a876ab6c3fd5 rust/hg-core/src/vfs.rs --- 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() }