Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Move bufwriter out of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
imerr committed May 9, 2023
1 parent 103e49f commit dd4a1dc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "imgur_id7"
version = "0.1.1"
version = "0.1.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ async fn main() {
.create(true)
.open(out_file.as_str()).await {
Ok(mut filef) => {
let mut file = BufWriter::new(&mut filef);
loop {
let mut file = BufWriter::new(&mut filef);
if let Some(found) = done_rx.recv().await {
match file.write_all(format!("https://i.imgur.com/{}.jpg", found).as_bytes()).await {
Ok(_) => {}
Expand Down

0 comments on commit dd4a1dc

Please sign in to comment.