changeset 50809:d64df6b35007

rust-config: add docstring to inner `get_parse` method The signature is quite heavy, a docstring to explain the idea doesn't hurt.
author Raphaël Gomès <rgomes@octobus.net>
date Wed, 12 Jul 2023 10:59:19 +0200
parents 67faf1bd8acd
children 8250ecb53f30
files rust/hg-core/src/config/mod.rs
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/config/mod.rs	Thu Jul 06 11:44:30 2023 +0200
+++ b/rust/hg-core/src/config/mod.rs	Wed Jul 12 10:59:19 2023 +0200
@@ -386,6 +386,13 @@
         }))
     }
 
+    /// Return the config item that corresponds to a section + item, a function
+    /// to parse from the raw bytes to the expected type (which is passed as
+    /// a string only to make debugging easier).
+    /// Used by higher-level methods like `get_bool`.
+    ///
+    /// `fallback_to_default` controls whether the default value (if any) is
+    /// returned if nothing is found.
     fn get_parse<'config, T: 'config>(
         &'config self,
         section: &[u8],