Mercurial > public > mercurial-scm > hg
diff rust/hg-core/src/config/layer.rs @ 52760:94e2547e6f3d
rust: move code from utils to utils::strings
This moves string-related functions in hg::utils into the recently added
hg::utils::strings module.
author | Mitchell Kember <mkember@janestreet.com> |
---|---|
date | Thu, 16 Jan 2025 13:15:02 -0500 |
parents | 28a0eb21ff04 |
children |
line wrap: on
line diff
--- a/rust/hg-core/src/config/layer.rs Fri Jan 03 10:50:17 2025 -0500 +++ b/rust/hg-core/src/config/layer.rs Thu Jan 16 13:15:02 2025 -0500 @@ -57,7 +57,7 @@ cli_config_args: impl IntoIterator<Item = impl AsRef<[u8]>>, ) -> Result<Option<Self>, ConfigError> { fn parse_one(arg: &[u8]) -> Option<(Vec<u8>, Vec<u8>, Vec<u8>)> { - use crate::utils::SliceExt; + use crate::utils::strings::SliceExt; let (section_and_item, value) = arg.split_2(b'=')?; let (section, item) = section_and_item.trim().split_2(b'.')?; @@ -169,7 +169,8 @@ let line = Some(index + 1); if let Some(m) = INCLUDE_RE.captures(bytes) { let filename_bytes = &m[1]; - let filename_bytes = crate::utils::expand_vars(filename_bytes); + let filename_bytes = + crate::utils::strings::expand_vars(filename_bytes); // `Path::parent` only fails for the root directory, // which `src` can’t be since we’ve managed to open it as a // file.