Skip to content

Commit

Permalink
Fix example display
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathas-Conceicao <jonathas.conceicao@ossystems.com.br>
  • Loading branch information
Jonathas-Conceicao committed Apr 30, 2020
1 parent 6a89dde commit 327b994
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ Note that the provided functions do return their own `Output`
struct instead of [`std::process::Output`].

## Example
```rust, no_run
## fn run() -> Result<(), easy_process::Error> {
```rust
use easy_process;

// stdout
Expand All @@ -35,16 +34,13 @@ assert_eq!(&output.stdout, "1 2 3 4\n");
// stderr
let output = easy_process::run(r#"sh -c 'echo "1 2 3 4" >&2'"#)?;
assert_eq!(&output.stderr, "1 2 3 4\n");
## Ok(())
## }
## run();
```rust
```

[`std::process::Output`]: https://doc.rust-lang.org/std/process/struct.Output.html

Commands on windows are also supported in the same way:

```rust, no_run
```rust
let output = easy_process::run(r#"powershell /C 'echo "1 2 3 4"'"#)?;
assert_eq!(&output.stdout, "1 2 3 4\r\n");
```
Expand Down

0 comments on commit 327b994

Please sign in to comment.