mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-29 15:51:20 +00:00
Fixing clippy
This commit is contained in:
parent
ff5739cfc1
commit
dbb8fbcd84
1 changed files with 8 additions and 8 deletions
|
@ -40,26 +40,26 @@ impl DatabaseConfig {
|
||||||
self
|
self
|
||||||
.user
|
.user
|
||||||
.to_owned()
|
.to_owned()
|
||||||
.unwrap_or(DatabaseConfig::default().user.expect("missing user"))
|
.unwrap_or_else(|| DatabaseConfig::default().user.expect("missing user"))
|
||||||
}
|
}
|
||||||
pub fn port(&self) -> i32 {
|
pub fn port(&self) -> i32 {
|
||||||
self
|
self
|
||||||
.port
|
.port
|
||||||
.unwrap_or(DatabaseConfig::default().port.expect("missing port"))
|
.unwrap_or_else(|| DatabaseConfig::default().port.expect("missing port"))
|
||||||
}
|
}
|
||||||
pub fn database(&self) -> String {
|
pub fn database(&self) -> String {
|
||||||
self.database.to_owned().unwrap_or(
|
self.database.to_owned().unwrap_or_else(|| {
|
||||||
DatabaseConfig::default()
|
DatabaseConfig::default()
|
||||||
.database
|
.database
|
||||||
.expect("missing database"),
|
.expect("missing database")
|
||||||
)
|
})
|
||||||
}
|
}
|
||||||
pub fn pool_size(&self) -> u32 {
|
pub fn pool_size(&self) -> u32 {
|
||||||
self.pool_size.unwrap_or(
|
self.pool_size.unwrap_or_else(|| {
|
||||||
DatabaseConfig::default()
|
DatabaseConfig::default()
|
||||||
.pool_size
|
.pool_size
|
||||||
.expect("missing pool_size"),
|
.expect("missing pool_size")
|
||||||
)
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue