Updated highlighting
This commit is contained in:
@@ -10,7 +10,7 @@ Enums in Mist serve as powerful algebraic data types (ADTs), maintaining the exa
|
||||
|
||||
An enum can contain unit variants, tuple variants, or struct-like variants. Following Mist's core philosophy, struct-like variants place the type before the identifier.
|
||||
|
||||
```rust
|
||||
```mist
|
||||
public enum TaskState {
|
||||
Pending,
|
||||
InProgress,
|
||||
@@ -26,7 +26,7 @@ public enum TaskState {
|
||||
|
||||
Mist supports all standard variant shapes, ensuring a 1:1 mapping to the underlying Rust execution model.
|
||||
|
||||
```rust
|
||||
```mist
|
||||
enum Message {
|
||||
Quit, // Unit
|
||||
Move(i32, i32), // Tuple
|
||||
@@ -40,7 +40,7 @@ enum Message {
|
||||
|
||||
Just like structs and functions, enums declare generics and lifetimes in a unified block. This is particularly useful for defining custom Result or Option types that handle references.
|
||||
|
||||
```rust
|
||||
```mist
|
||||
public enum Validation<'a, T> {
|
||||
Valid(T),
|
||||
Invalid {
|
||||
|
||||
Reference in New Issue
Block a user