Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- impl Point {
- // Constructor, which is just a regular method
- pub fn new(x: f64, y: f64) -> Point {
- let mut p = Point{ x: 0.0, y: 0.0 };
- // Set the fields of Point through setters
- p.set_x(x);
- p.set_y(y);
- p
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement