summaryrefslogtreecommitdiffstats
path: root/lib/domain/libimagbookmark/src/store.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-03-07 16:04:33 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-03-08 11:43:24 +0100
commit8527d447ae2047e0d5d54cc70599a895b62a3ee0 (patch)
tree023de5d446d28c6a232308f8604e17a129ee49c7 /lib/domain/libimagbookmark/src/store.rs
parent00aa4df88edae1d5eeb3fb365af05f95bd0de3b4 (diff)
Replace failure with anyhow in complete codebase
This patch was scripted with sed -i 's/use failure::Error/use anyhow::Error/' $(rg "use failure::Error" -l) sed -i 's/use failure::Fallible as /use anyhow::/' $(rg "use failure::Fallible" -l) sed -i 's/failure/anyhow/' $(rg "failure *=" -l) sed -i 's/format_err!/anyhow!/' $(rg "format_err!" -l) sed -i 's/use failure::ResultExt/use anyhow::Context/' $(rg "use failure::ResultExt" -l) sed -i 's/err_msg/anyhow!/' $(rg "use failure::err_msg" -l) sed -i 's/^anyhow\ *=.*$/anyhow = "1"/' $(rg "anyhow * =" -l) sed -i 's/^anyhow_derive.*//' $(rg "anyhow_derive" -l) sed -i 's/extern crate failure/extern crate anyhow/' $(rg "extern crate failure" -l) sed -i 's/.*extern crate anyhow_derive.*//' $(rg "anyhow_derive" -l) Some manual changes were added as well, so this patch was not completely scripted, but mostly. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'lib/domain/libimagbookmark/src/store.rs')
-rw-r--r--lib/domain/libimagbookmark/src/store.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/domain/libimagbookmark/src/store.rs b/lib/domain/libimagbookmark/src/store.rs
index 536e8900..a9519302 100644
--- a/lib/domain/libimagbookmark/src/store.rs
+++ b/lib/domain/libimagbookmark/src/store.rs
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
-use failure::Fallible as Result;
+use anyhow::Result;
use uuid::Uuid;
use url::Url;
@@ -73,7 +73,7 @@ impl BookmarkStore for Store {
fn get_bookmark_by_id<'a>(&'a self, sid: StoreId) -> Result<Option<FileLockEntry<'a>>> {
if let Some(entry) = self.get(sid)? {
if !entry.is_bookmark()? {
- Err(format_err!("Not a bookmark: {}", entry.get_location()))
+ Err(anyhow!("Not a bookmark: {}", entry.get_location()))
} else {
Ok(Some(entry))
}
@@ -92,7 +92,7 @@ impl BookmarkStore for Store {
drop(fle);
self.delete(id)
} else {
- Err(format_err!("Not a bookmark: {}", fle.get_location()))
+ Err(anyhow!("Not a bookmark: {}", fle.get_location()))
}
}