Fix compiling

- I made some mistakes while checking my two previous PRs(Seems like I
don't understand Rust that great after all).
- Do the url encoding only on the password part, not only the whole URL.
- Fix `temporary value dropped while borrowed` compile error.
This commit is contained in:
Gusted
2022-10-22 21:28:58 +02:00
parent af35fdb48e
commit 8826f6df8f
3 changed files with 27 additions and 17 deletions

View File

@@ -68,10 +68,8 @@ impl Connect for ConnectionOptions {
async fn connect(self) -> DBResult<Self::Pool> {
let pool = match self {
Self::Fresh(fresh) => {
let mut connect_options = sqlx::mysql::MySqlConnectOptions::from_str(
&urlencoding::encode(&fresh.url),
)
.unwrap();
let mut connect_options =
sqlx::mysql::MySqlConnectOptions::from_str(&fresh.url).unwrap();
if fresh.disable_logging {
connect_options.disable_statement_logging();
}