about summary refs log tree commit diff
path: root/src/bin/kittybox_bulk_import.rs
diff options
context:
space:
mode:
authorVika Shleina <vika@fireburn.ru>2021-07-15 04:46:22 +0300
committerVika <vika@fireburn.ru>2021-07-19 04:57:11 +0300
commitdc490adb60db3d560e54cafe28ebf1f8ba1731b6 (patch)
tree8806c22c711e41cb478df2f969da4bdd69d2b9bc /src/bin/kittybox_bulk_import.rs
parentd399fd0bd00c9ea073e5b057de70c9ffdd9356f8 (diff)
downloadkittybox-dc490adb60db3d560e54cafe28ebf1f8ba1731b6.tar.zst
make clippy happy
Diffstat (limited to 'src/bin/kittybox_bulk_import.rs')
-rw-r--r--src/bin/kittybox_bulk_import.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/kittybox_bulk_import.rs b/src/bin/kittybox_bulk_import.rs
index 652a4c2..a5252b7 100644
--- a/src/bin/kittybox_bulk_import.rs
+++ b/src/bin/kittybox_bulk_import.rs
@@ -1,4 +1,4 @@
-use std::io::{self, Read};
+use std::io;
 use std::fs::File;
 use anyhow::{anyhow, Context, Result, bail};
 
@@ -24,10 +24,10 @@ async fn main() -> Result<()> {
     let url = surf::Url::parse(&args[1])?;
     let client = surf::Client::new();
 
-    let mut iter = data.into_iter();
+    let iter = data.into_iter();
 
-    while let Some(post) = iter.next() {
-        println!("Processing {}...", post["properties"]["url"][0].as_str().or(post["properties"]["published"][0].as_str().or(post["properties"]["name"][0].as_str().or(Some("<unidentified post>")))).unwrap());
+    for post in iter {
+        println!("Processing {}...", post["properties"]["url"][0].as_str().or_else(|| post["properties"]["published"][0].as_str().or_else(|| post["properties"]["name"][0].as_str().or(Some("<unidentified post>")))).unwrap());
         match client.post(&url)
             .body(surf::http::Body::from_string(
                 serde_json::to_string(&post)?))