MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / main

Function main

2a_builder_pattern/rust/builder/src/main.rs:77–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75}
76
77fn main() -> Result<(), Box<dyn std::error::Error>> {
78 let bob = User::builder(13, "bob@example.com")
79 .first_name("Bob")
80 .build();
81
82 println!("complete? {}", bob.complete());
83 println!("bob_the_builder = {:#?}\n\n", bob);
84
85 let c1 = ChannelBuilder::default()
86 .special_info("84")
87 .build()
88 .unwrap();
89 let c2 = ChannelBuilder::default()
90 .token(4321)
91 .build()?;
92 println!("{:?} {:?}", c1, c2);
93 println!("{} {}", c1.token, c2.special_info);
94 Ok(())
95}

Callers

nothing calls this directly

Calls 2

buildMethod · 0.45
first_nameMethod · 0.45

Tested by

no test coverage detected