From 1ccaac0e91492836bfc456059e0e14e4096151c4 Mon Sep 17 00:00:00 2001 From: BinChengZhao Date: Mon, 8 Jan 2024 14:02:42 +0800 Subject: [PATCH] fix: #50 --- Cargo.toml | 2 +- build/build.rs | 5 +++-- src/timer/runtime_trace/task_instance.rs | 5 ++++- src/utils/parse.rs | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 56d11f7..48c0d2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "delay_timer" -version = "0.11.4" +version = "0.11.5" authors = ["binchengZhao "] edition = "2018" repository = "https://github.com/BinChengZhao/delay-timer" diff --git a/build/build.rs b/build/build.rs index ea2e3a8..cf7282e 100644 --- a/build/build.rs +++ b/build/build.rs @@ -21,8 +21,9 @@ fn main() -> Result<()> { } } - // Check for a minimum version - if version()? >= Version::parse("1.51.0")? { + // When the rustc version is >= 1.51.0 and < 1.75.0, we can use the + let version = version()?; + if version >= Version::parse("1.51.0")? && version < Version::parse("1.75.0")? { println!("cargo:rustc-cfg=SPLIT_INCLUSIVE_COMPATIBLE"); } diff --git a/src/timer/runtime_trace/task_instance.rs b/src/timer/runtime_trace/task_instance.rs index 117204a..87d2d68 100644 --- a/src/timer/runtime_trace/task_instance.rs +++ b/src/timer/runtime_trace/task_instance.rs @@ -196,7 +196,10 @@ impl TaskInstancesChainMaintainer { self.inner_sender .send(instance.clone()) .await - .map_or((), |_| {}); + .map_err(|e| { + tracing::error!("push_instance error: {:?}", e); + }) + .ok(); self.inner_list.push_back(instance); } } diff --git a/src/utils/parse.rs b/src/utils/parse.rs index 9de44d0..fd0f262 100644 --- a/src/utils/parse.rs +++ b/src/utils/parse.rs @@ -342,7 +342,7 @@ pub mod shell_command { //By Option(Some(Result)), determine if there is an output stdio.. //By Result(OK(t)), determine if there is success open file. #[cfg(not(SPLIT_INCLUSIVE_COMPATIBLE))] - fn _has_redirect_file(command: &str) -> Option> { + fn _has_redirect_file(command: &str) -> Option> { let angle_bracket = if command.contains(">>") { ">>" } else if command.contains('>') {