MCPcopy Create free account
hub / github.com/derekbanas/Rust-Tutorial / new

Method new

main.rs:701–703  ·  view source on GitHub ↗

Constructor

(length: f32, width: f32)

Source from the content-addressed store, hash-verified

699 impl Shape for Rectangle{
700 // Constructor
701 fn new(length: f32, width: f32) -> Rectangle {
702 return Rectangle{length, width};
703 }
704
705 // self allows us to refer to parameters for this struct
706 fn area(&self) -> f32{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected