File: 0003-Fix-stdout-err-output.patch

package info (click to toggle)
rust-cid-npm 0.0~git20200813.59cf068-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 364 kB
  • sloc: javascript: 69; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 1,032 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date: Mon, 25 Jul 2022 11:28:44 +0200
Subject: Fix stdout/err output

Data should go to stdout, errors and other information to stderr.

Closes: #1
---
 src/bin/main.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/bin/main.rs b/src/bin/main.rs
index 2e16bc4..176c021 100644
--- a/src/bin/main.rs
+++ b/src/bin/main.rs
@@ -45,7 +45,7 @@ fn run(config: Config) -> Result<String, Box<dyn Error>> {
     
     let start = std::time::Instant::now();
 
-    println!("Reading from file: \"{}\" ...",&config.filename);
+    eprintln!("Reading from file: \"{}\" ...",&config.filename);
 
     let mut total = 0;
 
@@ -64,7 +64,7 @@ fn run(config: Config) -> Result<String, Box<dyn Error>> {
 
     let process_stats = get_process_stats();
 
-    eprintln!("{}", stats);
+    println!("{}", stats);
 
     let total = start.elapsed();
 
@@ -215,4 +215,4 @@ mod tests {
 
         assert_eq!(expected, result);    
     }
-}
\ No newline at end of file
+}