We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
import io::*; struct Point {x:float, y:float} enum Shape{ Circle(Point, float), Rectangle(Point, Point) } fn area(sh: Shape)->float{ match sh{ Circle(_,size)=>float::consts::pi*size*size, Rectangle(point1, point2)=>(point2.x-point1.x)*(point2.y-point1.y) } } fn main(){ Circle{(4.5,5.5,),1.0}; area(circle); }
it doesn't work.. I'm a person who is using english as second language.. So there's a problem to understand document..
Please Let me know how to use it properly