Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. use std::cell::Cell;
  2. use std::boxed::Box;
  3.  
  4. fn main()
  5. {
  6. let mut node = Node::new();
  7.  
  8. println!("{:?}", Node::FRAG);
  9. }
  10.  
  11. #[derive(Debug)]
  12. struct Node{
  13. node: Option<Box<Node>>
  14. }
  15.  
  16.  
  17. impl Node{
  18. const mut FRAG: bool = false;
  19.  
  20. fn new() -> Self{
  21. Self{
  22. node: Some(Box::new(Self{node: None}))
  23. }
  24. }
  25.  
  26. fn set_FRAG(b: bool) -> bool{
  27. Self::FRAG = b;
  28. b
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement