diff --git a/src/main.rs b/src/main.rs index e36a223..522a5c6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -71,7 +71,7 @@ fn wg_with_text( let wg_output_string = String::from_utf8(wg_output.stdout)?; let wg = WireGuard::try_from(&wg_output_string as &str)?; - Ok(Response::new(Body::from(wg.render()))) + Ok(Response::new(Body::from(wg.render_with_names(Some(&pehm))))) } fn perform_request( diff --git a/src/wireguard.rs b/src/wireguard.rs index 2817b4f..2f390d9 100644 --- a/src/wireguard.rs +++ b/src/wireguard.rs @@ -126,7 +126,7 @@ impl TryFrom<&str> for WireGuard { } impl WireGuard { - fn render_with_names(&self, pehm: Option<&PeerEntryHashMap>) -> String { + pub(crate) fn render_with_names(&self, pehm: Option<&PeerEntryHashMap>) -> String { let mut latest_handshakes = Vec::new(); let mut sent_bytes = Vec::new(); let mut received_bytes = Vec::new();