Skip to content

Commit

Permalink
doc: Update
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmah309 committed Aug 5, 2024
1 parent cab7716 commit a6225e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions book/src/libs/result/result.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import 'package:rust_core/result.dart';
void main() {
final result = processOrder("Bob", 2);
result.match(
ok: (value) => print("Success: $value"),
err: (error) => print("Error: $error"),
);
switch(result) {
Ok(:var ok) => print("Success: $ok"),
Err(:var err) => print("Error: $err"),
};
}
Result<String, String> processOrder(String user, int orderNumber) {
Expand Down

0 comments on commit a6225e5

Please sign in to comment.