conf: cargo fmt

This commit is contained in:
anna 2023-01-19 15:00:00 +01:00
parent 4bcaaa8f2f
commit 2c96fa702e
Signed by: fef
GPG key ID: EC22E476DC2D3D84

View file

@ -1,5 +1,5 @@
use std::env;
use jsonwebtoken::{DecodingKey, EncodingKey};
use std::env;
/// Central repository for the backend's config.
pub struct Config {
@ -13,7 +13,11 @@ pub struct Config {
impl Config {
pub fn from_env() -> Config {
let jwt_secret = parse_sha256(env::var("JWT_SECRET").expect("JWT_SECRET must be a 32-byte base-16 string").as_str());
let jwt_secret = parse_sha256(
env::var("JWT_SECRET")
.expect("JWT_SECRET must be a 32-byte base-16 string")
.as_str(),
);
Config {
bind_addr: env::var("BIND_ADDR").unwrap_or("localhost".into()),
bind_port: env::var("BIND_PORT")