on 5f6e310 help sign in
bat/tests/snapshots/sample.modified.rs
22 lines 461 B history raw
1struct Rectangle {
2 width: u32,
3 height: u32,
4}
6fn main() {
7 let rect1 = Rectangle { width: 30, height: 50 };
9 println!(
10 "The perimeter of the rectangle is {} pixels.",
11 perimeter(&rect1)
12 );
13 println!(r#"This line contains invalid utf8: "�����"#;
16fn area(rectangle: &Rectangle) -> u32 {
17 rectangle.width * rectangle.height
20fn perimeter(rectangle: &Rectangle) -> u32 {
21 (rectangle.width + rectangle.height) * 2