Skip to content

Instantly share code, notes, and snippets.

View lluchs's full-sized avatar

Lukas Werling lluchs

  • Karlsruhe, Germany
View GitHub Profile
@lluchs
lluchs / builder.rs
Last active November 14, 2020 10:57 — forked from anonymous/playground.rs
Rust builder pattern with lifetime on struct
struct Foo;
struct FooBuilder<'a> {
foo: &'a Foo,
}
impl Foo {
fn build(&self) -> FooBuilder {
FooBuilder { foo: &self }
}
}