[pagetop] Añade macro Getters para estructuras

This commit is contained in:
Manuel Cillero 2025-11-30 12:51:45 +01:00
parent 0f76cfe28b
commit 4944af073f
17 changed files with 154 additions and 390 deletions

View file

@ -8,8 +8,9 @@ const LINK: &str = "<a href=\"https://pagetop.cillero.es\" rel=\"noopener norefe
/// Por defecto, usando [`default()`](Self::default) sólo se muestra un reconocimiento a PageTop.
/// Sin embargo, se puede usar [`new()`](Self::new) para crear una instancia con un texto de
/// copyright predeterminado.
#[derive(AutoDefault)]
#[derive(AutoDefault, Getters)]
pub struct PoweredBy {
/// Devuelve el texto de copyright actual, si existe.
copyright: Option<String>,
}
@ -56,11 +57,4 @@ impl PoweredBy {
self.copyright = copyright.map(Into::into);
self
}
// **< PoweredBy GETTERS >**********************************************************************
/// Devuelve el texto de copyright actual, si existe.
pub fn copyright(&self) -> Option<&str> {
self.copyright.as_deref()
}
}