Add a package for demonstrating modules

This commit is contained in:
Manuel Thalmann 2025-01-08 11:13:17 +01:00
parent 9f25a0ae35
commit 4f0fdba18e
5 changed files with 24 additions and 0 deletions

7
backyard/Cargo.lock generated Normal file
View file

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "backyard"
version = "0.1.0"

6
backyard/Cargo.toml Normal file
View file

@ -0,0 +1,6 @@
[package]
name = "backyard"
version = "0.1.0"
edition = "2021"
[dependencies]

1
backyard/src/garden.rs Normal file
View file

@ -0,0 +1 @@
pub mod vegetables;

View file

@ -0,0 +1,2 @@
#[derive(Debug)]
pub struct Asparagus {}

8
backyard/src/main.rs Normal file
View file

@ -0,0 +1,8 @@
use crate::garden::vegetables::Asparagus;
pub mod garden;
fn main() {
let plant = Asparagus {};
println!("I'm growing {plant:?}!");
}