From a12ecb50fbdce79cce8e870290fe7a1253f74722 Mon Sep 17 00:00:00 2001 From: Francesco Cogno Date: Mon, 20 May 2019 10:21:32 +0200 Subject: [PATCH] Corrected wrong method --- src/main.rs | 2 +- src/wireguard.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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();