SHARE
TWEET

Untitled

a guest Aug 17th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top