update listings ch07 close #654

This commit is contained in:
KaiserY 2022-10-07 22:45:15 +08:00
parent 173ed4adc4
commit f873a162ef
6 changed files with 29 additions and 0 deletions

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"

View File

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

View File

@ -0,0 +1,5 @@
$ cargo run
Compiling backyard v0.1.0 (file:///projects/backyard)
Finished dev [unoptimized + debuginfo] target(s) in 0.36s
Running `target/debug/backyard`
I'm growing Asparagus!

View File

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

View File

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

View File

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