Skip to content

Commit

Permalink
fix(config): make config variables mutable
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenclaw900 committed Nov 20, 2021
1 parent efcb9c4 commit db7032e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/backend/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@ pub fn config() -> Config {
let port: u16 = cfg.get("port").unwrap_or(&Toml::Num(8088.0)).num() as u16;

let tls = cfg.get("tls").unwrap_or(&Toml::Bool(false));
let cert = String::new();
let key = String::new();
let mut cert = String::new();
let mut key = String::new();
if tls == &Toml::Bool(true) {
let cert = cfg
cert = cfg
.get("cert")
.unwrap_or(&Toml::Str(String::new()))
.str()
.to_string();
let key = cfg
key = cfg
.get("key")
.unwrap_or(&Toml::Str(String::new()))
.str()
.to_string();
}

let pass = cfg.get("pass").unwrap_or(&Toml::Bool(false));
let hash = String::new();
let secret = String::new();
let mut hash = String::new();
let mut secret = String::new();
if pass == &Toml::Bool(true) {
hash = cfg
.get("hash")
Expand Down

0 comments on commit db7032e

Please sign in to comment.