Skip to content
Snippets Groups Projects
Commit 9ddbb869 authored by Michael Hauspie's avatar Michael Hauspie
Browse files

Simplify main

parent 498efff4
Branches main
No related tags found
No related merge requests found
......@@ -3,12 +3,11 @@ An example of Builder pattern in rust
# Example usage
```rust
let builder = Bike::builder();
let bike = builder.with_brakes(Brake::Disk)
.with_transmission(Transmission::GearHub)
.with_wheels(Wheel::Small)
.build();
println!("{bike:#?}");
bike.ride();
let bike = Bike::builder()
.with_brakes(Brake::Disk)
.with_transmission(Transmission::GearHub)
.with_wheels(Wheel::Small)
.build().unwrap();
bike.ride();
```
......@@ -76,13 +76,11 @@ impl BikeBuilder {
}
fn main() {
let builder = Bike::builder();
let bike = builder
let bike = Bike::builder()
.with_brakes(Brake::Disk)
// .with_transmission(Transmission::GearHub)
.with_transmission(Transmission::GearHub)
.with_wheels(Wheel::Small)
.build().unwrap();
println!("{bike:#?}");
bike.ride();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment