Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. enum Value {
  2. String { offset: u8, size: u8 },
  3. }
  4.  
  5. fn some_function(value1: Value, value2: Value) {
  6. match (value1, value2) {
  7. (Value::String{offset: x1, size: x2},
  8. Value::String{offset: y1, size: y2}) => {},
  9. _ => {},
  10. }
  11. }
  12.  
  13. fn main() {
  14. let x = Value::String {offset: 1, size: 1};
  15. let y = Value::String {offset: 2, size: 2};
  16. some_function(x, y);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement