Skip to content

Require finishing function to be called? #148

Closed Answered by lkdm
lkdm asked this question in Q&A
Discussion options

You must be logged in to vote

Forgive me because I'm a Rust noob– but having thought about it, the body of the method is the finishing function:

    #[builder(finish_fn = init)]
    fn in_memory() -> Self {
        match Connection::open_in_memory() {
            Ok(cnx) => {
                let mut adapter = SqliteAdapter(cnx);
                adapter.run_migrations().expect("Migrations should run as expected");
                adapter
            }
            _ => panic!("Could not open Sqlite connection in memory."),
        }
    }

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Veetaha
Comment options

@lkdm
Comment options

Answer selected by lkdm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants