From 015ec84d50b815041e2046a8726e8e6ea022fbb6 Mon Sep 17 00:00:00 2001 From: samypr100 <3933065+samypr100@users.noreply.github.com> Date: Sun, 17 Mar 2024 15:04:56 -0400 Subject: [PATCH] Update enum_use.md to use a more neutral theme --- src/custom_types/enum/enum_use.md | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/custom_types/enum/enum_use.md b/src/custom_types/enum/enum_use.md index cf75c67ba4..561b3f5700 100644 --- a/src/custom_types/enum/enum_use.md +++ b/src/custom_types/enum/enum_use.md @@ -6,38 +6,38 @@ The `use` declaration can be used so manual scoping isn't needed: // An attribute to hide warnings for unused code. #![allow(dead_code)] -enum Status { - Rich, - Poor, +enum Stage { + Beginner, + Advanced, } -enum Work { - Civilian, - Soldier, +enum Role { + Student, + Teacher, } fn main() { // Explicitly `use` each name so they are available without // manual scoping. - use crate::Status::{Poor, Rich}; - // Automatically `use` each name inside `Work`. - use crate::Work::*; + use crate::Stage::{Beginner, Advanced}; + // Automatically `use` each name inside `Role`. + use crate::Role::*; - // Equivalent to `Status::Poor`. - let status = Poor; - // Equivalent to `Work::Civilian`. - let work = Civilian; + // Equivalent to `Stage::Beginner`. + let stage = Beginner; + // Equivalent to `Role::Student`. + let role = Student; - match status { + match stage { // Note the lack of scoping because of the explicit `use` above. - Rich => println!("The rich have lots of money!"), - Poor => println!("The poor have no money..."), + Beginner => println!("Beginners are starting their learning journey!"), + Advanced => println!("Advanced learners are mastering their subjects..."), } - match work { + match role { // Note again the lack of scoping. - Civilian => println!("Civilians work!"), - Soldier => println!("Soldiers fight!"), + Student => println!("Students are acquiring knowledge!"), + Teacher => println!("Teachers are spreading knowledge!"), } } ```