programming/rust.org
... ...
@@ -36,6 +36,18 @@ It is also interesting to separate the config structure+parser in a crate, so we
36 36
37 37
Create a struct with just the =version= field, and without =#[serde(deny_unknown_fields)]=, so it can "extract" the version field safely from a file that you don't know the rest of its structure and discard the rest.
38 38
39
+** Compound Match cases
40
+:PROPERTIES:
41
+:CREATED: [2024-09-24 Tue 14:24]
42
+:END:
43
+
44
+#+begin_src rust
45
+match value {
46
+ pattern if expr => { value },
47
+ /*...*/
48
+}
49
+#+end_src
50
+
39 51
* Embedded Rust
40 52
** General Reminders
41 53