diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2021-04-27 09:03:53 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-05-11 11:20:52 +0200 |
commit | 52bd280b4b95949cf130e4d7477c02ad2d2f81b3 (patch) | |
tree | d0432c3dbe53cabd7a8ad9b72271515f57d8ff9c /src/main.rs | |
parent | 36675cde12a648416537efcd0efe7e01188566b4 (diff) |
Refactor: Database connection setup code
This patch refactors the database connection setup code to involve less copying
of data in memory.
It also changes the configuration value type of the database port and the
database connection timeout setting to be `u16` instead of `String`, which is
another improvement.
Because the `DbConnectionConfig` type no longer holds owned values, it must be
annotated with a lifetime. Usages were adapted.
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 8547375..69dd0fa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -146,7 +146,7 @@ async fn main() -> Result<()> { Ok(repo) }; - let db_connection_config = crate::db::parse_db_connection_config(&config, &cli); + let db_connection_config = crate::db::parse_db_connection_config(&config, &cli)?; match cli.subcommand() { Some(("generate-completions", matches)) => generate_completions(matches), Some(("db", matches)) => { |