rclap 0.8.0

rclap is a Rust configuration utility to help to generate the clap structures. The main purpose is to reduce boilerplate code when using clap and expose the configuration requirements as a toml file.
Documentation
use std::{
    fmt::{self, Display, Formatter},
    str::FromStr,
};

#[derive(Clone, PartialEq)]
pub struct Secret<T>(T);

impl Display for Secret<String> {
    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
        write!(f, "****************")
    }
}
impl fmt::Debug for Secret<String> {
    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
        write!(f, "****************")
    }
}

impl FromStr for Secret<String> {
    type Err = String;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(Secret(s.to_string()))
    }
}

impl Secret<String> {
    pub fn new(value: &str) -> Self {
        Secret(value.to_string())
    }
    pub fn expose_secret(&self) -> String {
        self.0.clone()
    }
}

pub trait IntoSecret<T> {
    fn into_secret(self) -> Secret<T>;
}

impl IntoSecret<String> for &str {
    fn into_secret(self) -> Secret<String> {
        Secret(self.to_string())
    }
}