Skip to content

Commit 73c613a

Browse files
authored
Avoid leaking inner error types vol.3 (#907)
1 parent 745bef6 commit 73c613a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

espflash/src/error.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ pub enum Error {
234234
FileOpenError(String, #[source] io::Error),
235235

236236
#[error("Failed to parse partition table")]
237-
Partition(#[from] esp_idf_part::Error),
237+
Partition(CoreError),
238238

239239
#[error("Invalid response: {0}")]
240240
#[diagnostic(code(espflash::invalid_response))]
@@ -307,6 +307,12 @@ impl From<AppDescriptorError> for Error {
307307
}
308308
}
309309

310+
impl From<esp_idf_part::Error> for Error {
311+
fn from(err: esp_idf_part::Error) -> Self {
312+
Self::Partition(Box::new(err))
313+
}
314+
}
315+
310316
#[cfg(feature = "cli")]
311317
impl From<dialoguer::Error> for Error {
312318
fn from(err: dialoguer::Error) -> Self {

0 commit comments

Comments
 (0)