1
1
use std:: str:: FromStr ;
2
2
use std:: { collections:: HashMap , iter:: IntoIterator } ;
3
3
4
- use crate :: { config:: Config , error, path:: Expression , source:: Source , value:: Value } ;
4
+ use crate :: error:: Result ;
5
+ use crate :: { config:: Config , path:: Expression , source:: Source , value:: Value } ;
5
6
6
7
/// A configuration builder
7
8
///
@@ -72,7 +73,7 @@ impl ConfigBuilder {
72
73
/// # Errors
73
74
///
74
75
/// Fails if `Expression::from_str(key)` fails.
75
- pub fn set_default < S , T > ( mut self , key : S , value : T ) -> error :: Result < ConfigBuilder >
76
+ pub fn set_default < S , T > ( mut self , key : S , value : T ) -> Result < ConfigBuilder >
76
77
where
77
78
S : AsRef < str > ,
78
79
T : Into < Value > ,
@@ -100,7 +101,7 @@ impl ConfigBuilder {
100
101
/// # Errors
101
102
///
102
103
/// Fails if `Expression::from_str(key)` fails.
103
- pub fn set_override < S , T > ( mut self , key : S , value : T ) -> error :: Result < ConfigBuilder >
104
+ pub fn set_override < S , T > ( mut self , key : S , value : T ) -> Result < ConfigBuilder >
104
105
where
105
106
S : AsRef < str > ,
106
107
T : Into < Value > ,
@@ -118,7 +119,7 @@ impl ConfigBuilder {
118
119
/// # Errors
119
120
/// If source collection fails, be it technical reasons or related to inability to read data as `Config` for different reasons,
120
121
/// this method returns error.
121
- pub fn build ( self ) -> error :: Result < Config > {
122
+ pub fn build ( self ) -> Result < Config > {
122
123
Self :: build_internal ( self . defaults , self . overrides , & self . sources )
123
124
}
124
125
@@ -130,15 +131,15 @@ impl ConfigBuilder {
130
131
/// # Errors
131
132
/// If source collection fails, be it technical reasons or related to inability to read data as `Config` for different reasons,
132
133
/// this method returns error.
133
- pub fn build_cloned ( & self ) -> error :: Result < Config > {
134
+ pub fn build_cloned ( & self ) -> Result < Config > {
134
135
Self :: build_internal ( self . defaults . clone ( ) , self . overrides . clone ( ) , & self . sources )
135
136
}
136
137
137
138
fn build_internal (
138
139
defaults : HashMap < Expression , Value > ,
139
140
overrides : HashMap < Expression , Value > ,
140
141
sources : & [ Box < dyn Source + Send + Sync > ] ,
141
- ) -> error :: Result < Config > {
142
+ ) -> Result < Config > {
142
143
let mut cache: Value = HashMap :: < String , Value > :: new ( ) . into ( ) ;
143
144
144
145
// Add defaults
0 commit comments