diff options
author | Vika Shleina <vika@fireburn.ru> | 2021-07-15 04:46:22 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2021-07-19 04:57:11 +0300 |
commit | dc490adb60db3d560e54cafe28ebf1f8ba1731b6 (patch) | |
tree | 8806c22c711e41cb478df2f969da4bdd69d2b9bc /src/bin/pyindieblog_to_kittybox.rs | |
parent | d399fd0bd00c9ea073e5b057de70c9ffdd9356f8 (diff) | |
download | kittybox-dc490adb60db3d560e54cafe28ebf1f8ba1731b6.tar.zst |
make clippy happy
Diffstat (limited to 'src/bin/pyindieblog_to_kittybox.rs')
-rw-r--r-- | src/bin/pyindieblog_to_kittybox.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/bin/pyindieblog_to_kittybox.rs b/src/bin/pyindieblog_to_kittybox.rs index 7935da5..c932e0a 100644 --- a/src/bin/pyindieblog_to_kittybox.rs +++ b/src/bin/pyindieblog_to_kittybox.rs @@ -1,10 +1,9 @@ use std::collections::HashMap; use std::fs::File; -use anyhow::{Error, Result, Context, anyhow, bail}; +use anyhow::{Result, Context, anyhow}; use mobc_redis::redis; use mobc_redis::redis::AsyncCommands; use serde::{Serialize, Deserialize}; -use serde_json::json; #[derive(Default, Serialize, Deserialize)] struct PyindieblogData { @@ -16,10 +15,10 @@ struct PyindieblogData { async fn main() -> Result<()> { let mut args = std::env::args(); args.next(); // skip argv[0] which is the name - let redis_uri = args.next().ok_or(anyhow!("No Redis URI provided"))?; + let redis_uri = args.next().ok_or_else(|| anyhow!("No Redis URI provided"))?; let client = redis::Client::open(redis_uri.as_str()).with_context(|| format!("Failed to construct Redis client on {}", redis_uri))?; - let filename = args.next().ok_or(anyhow!("No filename provided for export"))?; + let filename = args.next().ok_or_else(|| anyhow!("No filename provided for export"))?; let mut data: Vec<serde_json::Value>; |