diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:44 +0000 |
commit | c23a457e72abe608715ac76f076f47dc42af07a5 (patch) | |
tree | 2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/gix/src/config/overrides.rs | |
parent | Releasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip |
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix/src/config/overrides.rs')
-rw-r--r-- | vendor/gix/src/config/overrides.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/vendor/gix/src/config/overrides.rs b/vendor/gix/src/config/overrides.rs index 4bdf4a13f..6b3fc728c 100644 --- a/vendor/gix/src/config/overrides.rs +++ b/vendor/gix/src/config/overrides.rs @@ -26,11 +26,15 @@ pub(crate) fn append( let mut file = gix_config::File::new(gix_config::file::Metadata::from(source)); for key_value in values { let key_value = key_value.as_ref(); - let mut tokens = key_value.splitn(2, |b| *b == b'=').map(|v| v.trim()); + let mut tokens = key_value.splitn(2, |b| *b == b'=').map(ByteSlice::trim); let key = tokens.next().expect("always one value").as_bstr(); let value = tokens.next(); - let key = gix_config::parse::key(key.to_str().map_err(|_| Error::InvalidKey { input: key.into() })?) - .ok_or_else(|| Error::InvalidKey { input: key.into() })?; + let key = gix_config::parse::key( + key.to_str() + .map_err(|_| Error::InvalidKey { input: key.into() })? + .into(), + ) + .ok_or_else(|| Error::InvalidKey { input: key.into() })?; let mut section = file.section_mut_or_create_new(key.section_name, key.subsection_name)?; let key = gix_config::parse::section::Key::try_from(key.value_name.to_owned()).map_err(|err| Error::SectionKey { @@ -38,7 +42,7 @@ pub(crate) fn append( key: key.value_name.into(), })?; let comment = make_comment(key_value); - let value = value.map(|v| v.as_bstr()); + let value = value.map(ByteSlice::as_bstr); match comment { Some(comment) => section.push_with_comment(key, value, &**comment), None => section.push(key, value), |