From dbff32f14e50d13a8c8c8cd689cc225b5a87a639 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Fri, 4 Oct 2024 06:28:18 +0200 Subject: [PATCH] cli: add short method summary to its documentation --- cli/src/cli_util.rs | 5 ++++- cli/src/config.rs | 9 +++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index 273acc4faa3..e4a16308df9 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -522,6 +522,8 @@ impl ReadonlyUserRepo { } } +/// Type-safe data structure for conditionally advancing bookmarks. +/// /// A bookmark that should be advanced to satisfy the "advance-bookmarks" /// feature. This is a helper for `WorkspaceCommandTransaction`. It provides a /// type-safe way to separate the work of checking whether a bookmark can be @@ -1999,7 +2001,8 @@ Then run `jj squash` to move the resolution into the conflicted commit."#, } } -/// A [`Transaction`] tied to a particular workspace. +/// An ongoing [`Transaction`] tied to a particular workspace. +/// /// `WorkspaceCommandTransaction`s are created with /// [`WorkspaceCommandHelper::start_transaction`] and committed with /// [`WorkspaceCommandTransaction::finish`]. The inner `Transaction` can also be diff --git a/cli/src/config.rs b/cli/src/config.rs index c22871dc234..30143fabf2c 100644 --- a/cli/src/config.rs +++ b/cli/src/config.rs @@ -455,10 +455,11 @@ pub fn existing_config_path() -> Result, ConfigError> { ConfigEnv::new().existing_config_path() } -/// Returns a path to the user-specific config file. If no config file is found, -/// tries to guess a reasonable new location for it. If a path to a new config -/// file is returned, the parent directory may be created as a result of this -/// call. +/// Returns a path to the user-specific config file. +/// +/// If no config file is found, tries to guess a reasonable new +/// location for it. If a path to a new config file is returned, the +/// parent directory may be created as a result of this call. pub fn new_config_path() -> Result, ConfigError> { ConfigEnv::new().new_config_path() }