From 5f71f0510e99751acd28335a0b3afab324965e73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Orhun=20Parmaks=C4=B1z?= Date: Tue, 23 Nov 2021 22:38:53 +0300 Subject: [PATCH] style(docs): display the documentation with its original title --- systeroid-core/src/sysctl.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/systeroid-core/src/sysctl.rs b/systeroid-core/src/sysctl.rs index 9596652..6182fa2 100644 --- a/systeroid-core/src/sysctl.rs +++ b/systeroid-core/src/sysctl.rs @@ -162,16 +162,12 @@ impl Parameter { /// Returns the parameter documentation if it exists. pub fn get_documentation(&self) -> Option { self.description.as_ref().map(|description| { - let title = if let Some(absolute_name) = self.name.split('.').last() { - self.docs_title.replacen(absolute_name, &self.name, 1) - } else { - self.name.to_owned() - }; format!( - "{}\n{}\n{}\n-\nReference: {}", - title, - "=".repeat(title.len()), + "{}\n{}\n{}\n-\nParameter: {}\nReference: {}", + self.docs_title, + "=".repeat(self.docs_title.len()), description, + self.name, self.docs_path.to_string_lossy() ) })