diff rust/hg-core/src/config/config.rs @ 46447:0cb1b02228a6

rust: use HgError in ConfigError Differential Revision: https://phab.mercurial-scm.org/D9938
author Simon Sapin <simon.sapin@octobus.net>
date Mon, 01 Feb 2021 12:55:31 +0100
parents 1dcd9c9975ed
children 0d734c0ae1cf
line wrap: on
line diff
--- a/rust/hg-core/src/config/config.rs	Thu Jan 28 20:31:42 2021 +0100
+++ b/rust/hg-core/src/config/config.rs	Mon Feb 01 12:55:31 2021 +0100
@@ -8,7 +8,9 @@
 // GNU General Public License version 2 or any later version.
 
 use super::layer;
-use crate::config::layer::{ConfigError, ConfigLayer, ConfigValue};
+use crate::config::layer::{
+    ConfigError, ConfigLayer, ConfigParseError, ConfigValue,
+};
 use std::path::PathBuf;
 
 use crate::repo::Repo;
@@ -89,11 +91,11 @@
         &self,
         section: &[u8],
         item: &[u8],
-    ) -> Result<Option<bool>, ConfigError> {
+    ) -> Result<Option<bool>, ConfigParseError> {
         match self.get_inner(&section, &item) {
             Some((layer, v)) => match parse_bool(&v.bytes) {
                 Some(b) => Ok(Some(b)),
-                None => Err(ConfigError::Parse {
+                None => Err(ConfigParseError {
                     origin: layer.origin.to_owned(),
                     line: v.line,
                     bytes: v.bytes.to_owned(),