summaryrefslogtreecommitdiffstats
path: root/melib/src
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2020-06-20 11:12:37 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2020-06-20 13:14:40 +0300
commit8bfdce6658b3adbbf487923c512e68cac58fef68 (patch)
treed57bea8fb1edc1154dbec106d16e97d8dd729cfd /melib/src
parent75f9256a50e8878ed6b17288a94989df91aeaf1c (diff)
melib/error: do not discard old summary in set_summary
Diffstat (limited to 'melib/src')
-rw-r--r--melib/src/error.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/melib/src/error.rs b/melib/src/error.rs
index e481fa00..2f9ac553 100644
--- a/melib/src/error.rs
+++ b/melib/src/error.rs
@@ -92,7 +92,11 @@ impl MeliError {
where
M: Into<Cow<'static, str>>,
{
- self.summary = Some(summary.into());
+ if let Some(old_summary) = self.summary.take() {
+ self.summary = Some(format!("{}. {}", old_summary, summary.into()).into());
+ } else {
+ self.summary = Some(summary.into());
+ }
self
}
@@ -118,12 +122,6 @@ impl fmt::Display for MeliError {
}
}
-impl Into<String> for MeliError {
- fn into(self) -> String {
- self.details.into()
- }
-}
-
impl Error for MeliError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
self.source.as_ref().map(|s| &(*(*s)) as _)