Minor tidy

[?]
Jan 10, 2022, 1:37 AM
RNW6D77774CYWWM7JIFXI5TGKBOU6ADJIEZB5N2FXGDCTLUXEQZQC

Dependencies

  • [2] AV73DYWQ Initial functions for using sqlite in async environment
  • [3] HMOBTVJ4 Initialize crate and add expected dependencies

Change contents

  • replacement in src/names_database.rs at line 16
    [2.545][2.545:646]()
    struct AsyncConnection(
    mpsc::Sender<Box<dyn for<'a> FnOnce(&'a sqlite::Connection) + Send>>,
    );
    [2.545]
    [2.646]
    type DBFunction = Box<dyn for<'a> FnOnce(&'a sqlite::Connection) + Send>;
  • edit in src/names_database.rs at line 18
    [2.647]
    [2.647]
    pub struct AsyncConnection(mpsc::Sender<DBFunction>);
  • replacement in src/names_database.rs at line 24
    [2.806][2.806:960]()
    let (tx, mut rx): (
    _,
    mpsc::Receiver<Box<dyn for<'a> FnOnce(&sqlite::Connection) + Send>>,
    ) = mpsc::channel(1);
    [2.806]
    [2.960]
    let (tx, mut rx): (_, mpsc::Receiver<DBFunction>) = mpsc::channel(1);
  • edit in src/main.rs at line 1
    [3.49]
    [2.1990]
    mod gather;
  • replacement in src/main.rs at line 5
    [2.2026][2.2026:2044](),[2.2044][3.62:93](),[3.62][3.62:93]()
    async fn main() {
    println!("Hello, world!");
    [2.2026]
    [3.93]
    async fn main() -> Result<(), Box<dyn std::error::Error>> {
    use std::env;
    let _db = names_database::AsyncConnection::open(env::args().nth(1).ok_or(ArgsError::NoArgs)?).await?;
    Ok(())
  • edit in src/main.rs at line 10
    [3.95]
    #[derive(Debug)]
    enum ArgsError {
    NoArgs,
    }
    impl std::error::Error for ArgsError {}