Merge branch 'main' into configuration
This commit is contained in:
commit
5087d4738d
27
src/lib.rs
27
src/lib.rs
|
@ -127,7 +127,7 @@ impl Default for InstanceSettings {
|
|||
/// she/her or she/her/hers.
|
||||
///
|
||||
/// Methods are provided to quickly generate these shorter forms, as well as example sentences.
|
||||
#[derive(Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
|
||||
#[derive(Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
#[serde(from = "[String; 5]", into = "[String; 5]")]
|
||||
pub struct Pronoun {
|
||||
|
||||
|
@ -174,6 +174,31 @@ impl Pronoun {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Pronoun {
|
||||
/// Pronouns are formatted with a vertical bar seperating forms
|
||||
///
|
||||
/// ## Example
|
||||
///
|
||||
/// ```
|
||||
/// # use pronouns_today::Pronoun;
|
||||
/// let pronoun: Pronoun = ["she", "her", "her", "hers", "herself"].into();
|
||||
/// assert_eq!(
|
||||
/// format!("{:?}", pronoun),
|
||||
/// "Pronoun(she | her | her | hers | herself)"
|
||||
/// )
|
||||
/// ```
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f,
|
||||
"Pronoun({} | {} | {} | {} | {})",
|
||||
self.subject_pronoun,
|
||||
self.object_pronoun,
|
||||
self.possesive_determiner,
|
||||
self.possesive_pronoun,
|
||||
self.reflexive_pronoun,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Pronoun {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str(&self.render_threeform())
|
||||
|
|
Loading…
Reference in a new issue