From 4e8f910351696ef198c8fbebc6158c425d4f3319 Mon Sep 17 00:00:00 2001 From: ElBe <90863907+ElBe-Plaq@users.noreply.github.com> Date: Thu, 14 Sep 2023 19:33:36 +0200 Subject: [PATCH] Added struct field documentation --- src/errors.rs | 3 +++ src/lib.rs | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 3040da8..222f118 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -58,8 +58,11 @@ use std::fmt; /// ``` #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] pub struct Error { + /// The errors name. pub name: String, + /// The error description. pub description: String, + /// The errors exit code. pub exit_code: i32, } diff --git a/src/lib.rs b/src/lib.rs index c7819cd..d4fa982 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -#![doc = ".github/README.md"] +#![doc = include_str!("../.github/README.md")] // localizer-rs // Version: 1.1.0 @@ -52,7 +52,8 @@ use serde_json; /// /// # Parameters /// -/// - `path`: The directory containing the translation files. The directory is relative to the path the executable was executed from. +/// - `path`: The directory containing the translation files. +/// The directory is relative to the path the executable was executed from. /// - `language`: The language to translate to. /// /// # Returns @@ -70,7 +71,10 @@ use serde_json; /// ``` #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] pub struct Config { + /// The directory containing the translation files. The directory is relative to the path the + /// executable was executed from. pub path: String, + /// The language to translate to. pub language: String, } @@ -84,7 +88,8 @@ impl Config { /// /// # Parameters /// - /// - `path`: The directory containing the translation files. The directory is relative to the path the executable was executed from. + /// - `path`: The directory containing the translation files. + /// The directory is relative to the path the executable was executed from. /// - `language`: The language to translate to. /// /// # Returns @@ -122,7 +127,8 @@ impl Config { /// # Parameters /// /// - `self`: The config object. This must be mutable. - /// - `str_path`: The directory containing the translation files. The directory is relative to the path the executable was executed from. + /// - `str_path`: The directory containing the translation files. + /// The directory is relative to the path the executable was executed from. /// /// # Returns ///