Skip to content

Commit

Permalink
big_examples: Add snappy
Browse files Browse the repository at this point in the history
  • Loading branch information
losfair committed May 27, 2018
1 parent 51d53fa commit caf8c8c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions big_examples/snappy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
12 changes: 12 additions & 0 deletions big_examples/snappy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "snappy"
version = "0.1.0"
authors = ["losfair <[email protected]>"]

[lib]
name = "snappy"
crate-type = ["cdylib"]

[dependencies]
cwa = { path = "../.." }
snap = "0.2"
14 changes: 14 additions & 0 deletions big_examples/snappy/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#[macro_use]
extern crate cwa;

extern crate snap;

main!({
::cwa::io::with_stdin(|stdin| {
::cwa::io::with_stdout(|stdout| {

let mut writer = snap::Writer::new(stdout);
::std::io::copy(stdin, &mut writer).unwrap();
});
});
});

0 comments on commit caf8c8c

Please sign in to comment.