Skip to content

Commit 125503f

Browse files
committed
Fix CLI build on windows
1 parent 450c674 commit 125503f

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

cli/src/util.rs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ use std::path::PathBuf;
1313
use std::process::{Child, ChildStdin, Command, Stdio};
1414

1515
#[cfg(unix)]
16-
const HTML_HEADER: &[u8] = b"<!DOCTYPE html>\n<style>svg { width: 100%; }</style>\n\n";
16+
const HTML_HEADER: &[u8] = b"
17+
<!DOCTYPE html>
18+
19+
<style>
20+
svg { width: 100%; }
21+
</style>
22+
23+
";
1724

1825
pub fn cancel_on_stdin() -> Arc<AtomicUsize> {
1926
let result = Arc::new(AtomicUsize::new(0));
@@ -40,25 +47,30 @@ pub struct LogSession {
4047
dot_process_stdin: Option<ChildStdin>,
4148
}
4249

50+
#[cfg(windows)]
51+
pub fn print_tree_graph(_tree: &Tree, _path: &str) -> Result<()> {
52+
Ok(())
53+
}
54+
55+
#[cfg(windows)]
56+
pub fn log_graphs(_parser: &mut Parser, _path: &str) -> Result<LogSession> {
57+
Ok(LogSession)
58+
}
59+
60+
#[cfg(unix)]
4361
pub fn print_tree_graph(tree: &Tree, path: &str) -> Result<()> {
4462
let session = LogSession::new(path)?;
4563
tree.print_dot_graph(session.dot_process_stdin.as_ref().unwrap());
4664
Ok(())
4765
}
4866

67+
#[cfg(unix)]
4968
pub fn log_graphs(parser: &mut Parser, path: &str) -> Result<LogSession> {
5069
let session = LogSession::new(path)?;
5170
parser.print_dot_graphs(session.dot_process_stdin.as_ref().unwrap());
5271
Ok(session)
5372
}
5473

55-
#[cfg(windows)]
56-
impl LogSession {
57-
fn new(path: &str) -> Result<Self> {
58-
Ok(Self)
59-
}
60-
}
61-
6274
#[cfg(unix)]
6375
impl LogSession {
6476
fn new(path: &str) -> Result<Self> {

0 commit comments

Comments
 (0)