From 5f9b44ff15c4842ddf3793f7ce8e9f6b984bd78f Mon Sep 17 00:00:00 2001 From: dvkt Date: Fri, 20 Dec 2019 16:22:38 -0800 Subject: [PATCH] simpler --- src/main.rs | 2 +- src/ui.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9bef611..78dabc2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,7 +47,7 @@ fn main() { let mut ui = UI::new(); if let Err(e) = ui.open(url) { - ui::error(&e.to_string()); + eprintln!("{}", e); exit(1); } ui.run(); diff --git a/src/ui.rs b/src/ui.rs index b893278..51ab83f 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -150,7 +150,7 @@ impl UI { }); // main thread - check for updates in a loop - let mut res = String::new(); + let res; loop { if let Ok(body) = rx.try_recv() { spintx.send(true); @@ -161,7 +161,7 @@ impl UI { return Err(io_error("Connection error".into())); } } - res.push_str(&body); + res = body; break; } }