@dontblink e.g.
enum OsResponseType {
Message { message: String },
Bool(bool),
}
fn find\_os(os: OperativeSystem) -\> OsResponseType {
match os {
OperativeSystem::Linux =\> OsResponseType::Message {
message: "This pc uses Linux".into(),
},
OperativeSystem::Windows =\> OsResponseType::Bool(false),
OperativeSystem::Mac =\> OsResponseType::Bool(true),
\_ =\> OsResponseType::Bool(false),
}
}
Note the logic here is nonsense
@dontblink It feels like you should never
OsResponseType::Bool(true)
so you could probably encode that in the enum just as the sameUnrecognised
enum OsResponseType { Message { message: String }, Unrecognised }