1
0
Fork 0
mirror of https://github.com/mCaptcha/mCaptcha.git synced 2025-05-03 21:52:49 +03:00

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
No known key found for this signature in database
GPG key ID: FD821B732837125F
3 changed files with 27 additions and 17 deletions
db/db-sqlx-postgres/src

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::postgres::PgConnectOptions::from_str(
&urlencoding::encode(&fresh.url),
)
.unwrap();
let mut connect_options =
sqlx::postgres::PgConnectOptions::from_str(&fresh.url).unwrap();
if fresh.disable_logging {
connect_options.disable_statement_logging();
}