From: Greg Burri Date: Tue, 6 Sep 2022 10:10:09 +0000 (+0200) Subject: Rename ch4 to ch5 (it was a mistake) X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=27f3e5f9d6afb3a9888db8a57de493ec02941689;p=rust_in_action.git Rename ch4 to ch5 (it was a mistake) --- diff --git a/ch3-cubsat-ground-station/Cargo.lock b/ch3-cubsat-ground-station/Cargo.lock deleted file mode 100644 index 525f21a..0000000 --- a/ch3-cubsat-ground-station/Cargo.lock +++ /dev/null @@ -1,7 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "ch3-cubsat-ground-station" -version = "0.1.0" diff --git a/ch3-cubsat-ground-station/Cargo.toml b/ch3-cubsat-ground-station/Cargo.toml deleted file mode 100644 index 55d009f..0000000 --- a/ch3-cubsat-ground-station/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "ch3-cubsat-ground-station" -version = "0.1.0" -edition = "2018" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/ch3-cubsat-ground-station/src/main.rs b/ch3-cubsat-ground-station/src/main.rs deleted file mode 100644 index 7334bf0..0000000 --- a/ch3-cubsat-ground-station/src/main.rs +++ /dev/null @@ -1,42 +0,0 @@ -#![cfg_attr(debug_assertions, allow(unused_variables, dead_code))] - -use std::cell::RefCell; -use std::rc::Rc; - -type Message = String; - -#[derive(Debug)] -enum StatusMessage { - Ok, -} - -#[derive(Debug)] -struct Mailbox { - messages: Vec, -} - -#[derive(Debug)] -struct CubeSat { - id: u64, - mailbox: Mailbox, -} - -#[derive(Debug)] -struct GroundStation { - radio_freq: f64 // [MHz]. -} - -fn check_status(sat_id: &CubeSat) -> StatusMessage { - StatusMessage::Ok -} - -fn main() { - let base: Rc> = - Rc::new( - RefCell::new( - GroundStation { radio_freq: 42.1 } - ) - ); - - println!("base: {:?}", base); -} diff --git a/ch4-cubsat-ground-station/Cargo.lock b/ch4-cubsat-ground-station/Cargo.lock new file mode 100644 index 0000000..525f21a --- /dev/null +++ b/ch4-cubsat-ground-station/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ch3-cubsat-ground-station" +version = "0.1.0" diff --git a/ch4-cubsat-ground-station/Cargo.toml b/ch4-cubsat-ground-station/Cargo.toml new file mode 100644 index 0000000..3404e08 --- /dev/null +++ b/ch4-cubsat-ground-station/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "ch3-cubsat-ground-station" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/ch4-cubsat-ground-station/src/main.rs b/ch4-cubsat-ground-station/src/main.rs new file mode 100644 index 0000000..7334bf0 --- /dev/null +++ b/ch4-cubsat-ground-station/src/main.rs @@ -0,0 +1,42 @@ +#![cfg_attr(debug_assertions, allow(unused_variables, dead_code))] + +use std::cell::RefCell; +use std::rc::Rc; + +type Message = String; + +#[derive(Debug)] +enum StatusMessage { + Ok, +} + +#[derive(Debug)] +struct Mailbox { + messages: Vec, +} + +#[derive(Debug)] +struct CubeSat { + id: u64, + mailbox: Mailbox, +} + +#[derive(Debug)] +struct GroundStation { + radio_freq: f64 // [MHz]. +} + +fn check_status(sat_id: &CubeSat) -> StatusMessage { + StatusMessage::Ok +} + +fn main() { + let base: Rc> = + Rc::new( + RefCell::new( + GroundStation { radio_freq: 42.1 } + ) + ); + + println!("base: {:?}", base); +} diff --git a/ch5-data-in-depth/Cargo.toml b/ch5-data-in-depth/Cargo.toml index 3d2628b..ac9283c 100644 --- a/ch5-data-in-depth/Cargo.toml +++ b/ch5-data-in-depth/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "ch5-data-in-depth" version = "0.1.0" -edition = "2018" +edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html