From 972c980b83b28d5ed9fedc7978846cef7b2ea43c Mon Sep 17 00:00:00 2001 From: Adrian Groh <50576978+Gobidev@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:12:15 +0100 Subject: [PATCH] Fix MemoryReadout doctest (#183) --- src/traits.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/traits.rs b/src/traits.rs index 4f56dc5..7e50a16 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -199,6 +199,21 @@ impl MemoryReadout for MacOSMemoryReadout { // Get the currently used memory. Ok(256 * 1024) // Return 256mb in kilobytes. } + + fn swap_total(&self) -> Result { + // Get the total amount of swap. + Ok(4096 * 1024) // Return 4096mb in kilobytes. + } + + fn swap_free(&self) -> Result { + // Get the amount of free swap. + Ok(277 * 1024) // Return 277mb in kilobytes. + } + + fn swap_used(&self) -> Result { + // Get the currently used swap. + Ok(4 * 1024) // Return 4mb in kilobytes. + } } ```