Skip to content

Commit

Permalink
chore(deps): bump process-stream to 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
kkharji committed Jun 26, 2022
1 parent 2d7c458 commit 020c1a5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xclog"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
description = "xcodebuild build-log formater and parser"
license = "MIT OR Apache-2.0"
Expand All @@ -26,7 +26,7 @@ tracing-subscriber = { version = "0.3.9", features = ["env-filter"], optiona

anyhow = "1.0.57"
async-stream = "0.3.3"
process-stream = "0.3.2"
process-stream = "0.4.0"
paste = "1.0.7"
derive_is_enum_variant = "0.1.1"
serde = { version = "1.0.137", features = ["derive"] }
Expand Down
1 change: 1 addition & 0 deletions src/compile/tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use super::*;
use crate::XCLogger;
use process_stream::{ProcessExt, StreamExt};

fn get_compile_commands(content: &str) -> XCCompilationDatabase {
Expand Down
22 changes: 11 additions & 11 deletions src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use std::path::PathBuf;
use std::sync::Arc;
use std::{path::Path, pin::Pin};
use tokio::process::Command;
use tokio::sync::mpsc::Sender;
use tokio::sync::Mutex;
use tokio::sync::Notify;

/// XCLogger struct
#[derive(derive_deref_rs::Deref)]
Expand All @@ -18,7 +18,7 @@ pub struct XCLogger {
root: PathBuf,
#[deref]
inner: tokio::process::Command,
kill_send: Option<Sender<()>>,
abort: Option<Arc<Notify>>,
/// Arc Reference to compile_commands
pub compile_commands: Arc<Mutex<Vec<XCCompileCommand>>>,
}
Expand All @@ -28,14 +28,6 @@ impl ProcessExt for XCLogger {
&mut self.inner
}

fn killer(&self) -> Option<Sender<()>> {
self.kill_send.clone()
}

fn set_killer(&mut self, killer: Sender<()>) {
self.kill_send = killer.into()
}

fn spawn_and_stream(
&mut self,
) -> std::io::Result<Pin<Box<dyn Stream<Item = ProcessItem> + Send>>> {
Expand Down Expand Up @@ -77,6 +69,14 @@ impl ProcessExt for XCLogger {
}
.boxed())
}

fn aborter(&self) -> Option<Arc<Notify>> {
self.abort.clone()
}

fn set_aborter(&mut self, aborter: Option<Arc<Notify>>) {
self.abort = aborter
}
}

impl XCLogger {
Expand All @@ -95,7 +95,7 @@ impl XCLogger {
Ok(Self {
root: root.as_ref().to_path_buf(),
inner,
kill_send: None,
abort: None,
compile_commands: Default::default(),
})
}
Expand Down

0 comments on commit 020c1a5

Please sign in to comment.