From ece97615567c7bc537f960d1784d652b11c0e66c Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sun, 18 Aug 2024 23:13:03 -0700 Subject: [PATCH 1/1] Separate library & executable --- src/lib.rs | 3 +++ src/main.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 src/lib.rs diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..820f43e --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,3 @@ +pub fn tablify(_input: &impl std::io::Read) -> String { + String::from("Hello, world!") +} diff --git a/src/main.rs b/src/main.rs index e7a11a9..95f468f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,3 @@ fn main() { - println!("Hello, world!"); + print!("{}", tablify::tablify(&std::io::stdin())); } -- 2.44.1