Show More
@@ -160,20 +160,28 b' impl ConfigLayer {' | |||
|
160 | 160 | // `Path::join` with an absolute argument correctly ignores the |
|
161 | 161 | // base path |
|
162 | 162 | let filename = dir.join(&get_path_from_bytes(&filename_bytes)); |
|
163 |
|
|
|
164 |
|
|
|
165 | origin: ConfigOrigin::File(src.to_owned()), | |
|
166 | line, | |
|
167 |
|
|
|
168 | b"cannot include {} ({})", | |
|
169 | filename_bytes, | |
|
170 | format_bytes::Utf8(io_error) | |
|
171 | ), | |
|
163 | match std::fs::read(&filename) { | |
|
164 | Ok(data) => { | |
|
165 | layers.push(current_layer); | |
|
166 | layers.extend(Self::parse(&filename, &data)?); | |
|
167 | current_layer = | |
|
168 | Self::new(ConfigOrigin::File(src.to_owned())); | |
|
172 | 169 | } |
|
173 |
|
|
|
174 | layers.push(current_layer); | |
|
175 | layers.extend(Self::parse(&filename, &data)?); | |
|
176 |
|
|
|
170 | Err(error) => { | |
|
171 | if error.kind() != std::io::ErrorKind::NotFound { | |
|
172 | return Err(ConfigParseError { | |
|
173 | origin: ConfigOrigin::File(src.to_owned()), | |
|
174 | line, | |
|
175 | message: format_bytes!( | |
|
176 | b"cannot include {} ({})", | |
|
177 | filename_bytes, | |
|
178 | format_bytes::Utf8(error) | |
|
179 | ), | |
|
180 | } | |
|
181 | .into()); | |
|
182 | } | |
|
183 | } | |
|
184 | } | |
|
177 | 185 | } else if let Some(_) = EMPTY_RE.captures(&bytes) { |
|
178 | 186 | } else if let Some(m) = SECTION_RE.captures(&bytes) { |
|
179 | 187 | section = m[1].to_vec(); |
General Comments 0
You need to be logged in to leave comments.
Login now