Advertisement
cwchen

[Rust] The (public) getters of Point class

Aug 28th, 2017
3,400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.20 KB | None | 0 0
  1. impl Point {
  2.     // Getter for x, public
  3.     pub fn x(& self) -> f64 {
  4.         self.x
  5.     }
  6. }
  7.  
  8. impl Point {
  9.     // Getter for y, public
  10.     pub fn y(& self) -> f64 {
  11.         self.y
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement