SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fn main() {}
  2.  
  3. enum A {
  4.     Foo(String)
  5. }
  6.  
  7. enum AMut<'a> {
  8.     Foo(&'a mut String)
  9. }
  10.  
  11. impl A {
  12.     fn as_ref_mut(&mut self) -> AMut {
  13.         match *self {
  14.             A::Foo(ref mut s) => AMut::Foo(s)
  15.         }
  16.     }
  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
 
Top