From 4f96a3572db178e43da026a98fb1f3bd64834838 Mon Sep 17 00:00:00 2001 From: melfey Date: Thu, 10 Sep 2026 21:16:57 -0500 Subject: [PATCH] feat: bin example now references the local example_lib --- Cargo.lock | 3 +++ example_bin/Cargo.toml | 1 + example_bin/src/main.rs | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index bcbdc71..1f07418 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5,6 +5,9 @@ version = 4 [[package]] name = "example_bin" version = "0.1.0" +dependencies = [ + "example_lib", +] [[package]] name = "example_lib" diff --git a/example_bin/Cargo.toml b/example_bin/Cargo.toml index d734bc5..2f3ebc2 100644 --- a/example_bin/Cargo.toml +++ b/example_bin/Cargo.toml @@ -4,3 +4,4 @@ version = "0.1.0" edition = "2024" [dependencies] +example_lib = { path = "../example_lib" } diff --git a/example_bin/src/main.rs b/example_bin/src/main.rs index e7a11a9..ee45461 100644 --- a/example_bin/src/main.rs +++ b/example_bin/src/main.rs @@ -1,3 +1,11 @@ +use example_lib::*; + fn main() { println!("Hello, world!"); + + let result = add(1, 1); + assert_eq!(result, 2); + + let result = sub(1, 1); + assert_eq!(result, 0); }