diff --git a/src/api/mod.rs b/src/api/mod.rs index 1fe8d40..fe5bc4d 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -250,9 +250,10 @@ mod tests { use axum::http::{HeaderMap, HeaderValue, header}; fn config() -> crate::config::Config { - let mut config = crate::config::Config::default(); - config.public_url = "http://10.4.1.222:7800".into(); - config + crate::config::Config { + public_url: "http://10.4.1.222:7800".into(), + ..Default::default() + } } fn headers(origin: &str, host: &str) -> HeaderMap { diff --git a/src/preview.rs b/src/preview.rs index 89ff634..5be0164 100644 --- a/src/preview.rs +++ b/src/preview.rs @@ -277,8 +277,10 @@ mod tests { #[test] fn a_preview_host_carries_room_port_expiry_and_signature() { - let mut config = Config::default(); - config.preview_origin = "https://preview.example.com".into(); + let config = Config { + preview_origin: "https://preview.example.com".into(), + ..Default::default() + }; let (secrets, path) = secrets(); let url = url(&config, &secrets, "room123", 5173).expect("url"); let host = url @@ -296,8 +298,10 @@ mod tests { #[test] fn the_old_host_shape_is_not_accepted() { - let mut config = Config::default(); - config.preview_origin = "https://preview.example.com".into(); + let config = Config { + preview_origin: "https://preview.example.com".into(), + ..Default::default() + }; assert!( target_of_host( &config,