diff --git a/targets/file/src/lib.rs b/targets/file/src/lib.rs index 78d8190..1b0206c 100644 --- a/targets/file/src/lib.rs +++ b/targets/file/src/lib.rs @@ -1,6 +1,7 @@ use std::{ fs, io::{self, Write}, + mem, ops::ControlFlow, path::{Path, PathBuf}, sync::{Arc, Condvar, Mutex}, @@ -322,7 +323,7 @@ fn apply_retention( let _ = fs::remove_file(path); } - Ok(file_set.pop()) + Ok(file_set.first_mut().map(mem::take)) } struct Buffer { diff --git a/tests/smoke-test/main.rs b/tests/smoke-test/main.rs index d3b2523..d9c952a 100644 --- a/tests/smoke-test/main.rs +++ b/tests/smoke-test/main.rs @@ -36,7 +36,7 @@ async fn main() { .scope("some-scope", "0.1", emit::props! {}) .spawn() .unwrap()) - .and_to(emit_metrics::plot_metrics_by_count(30, emit_term::stdout())) + //.and_to(emit_metrics::plot_metrics_by_count(30, emit_term::stdout())) .and_to( emit_file::set("./target/logs/log.txt") .reuse_files(true) @@ -47,7 +47,7 @@ async fn main() { ) .init(); - emit::setup().to(emit_term::stdout()).init_internal(); + //emit::setup().to(emit_term::stdout()).init_internal(); sample_metrics();