Added some Display impls to response structs.

[?]
Apr 11, 2021, 12:44 PM
736HJN5EZZL5KLZP52TZQLDFE6ZXWEBLUHTHUE4IZ3EOUE3MNHAAC

Dependencies

Change contents

  • edit in src/response.rs at line 9
    [2.2860]
    [2.2860]
    }
    impl fmt::Display for Categories {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    let mut s = String::new();
    for category in &self.categories {
    s.push_str(&category.to_string());
    };
    write!(f, "{}", s)
    }
  • edit in src/response.rs at line 20
    [2.2862]
    [2.2862]
  • edit in src/response.rs at line 32
    [2.3198]
    [2.3198]
    impl fmt::Display for Category {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    write!(f,
    "id: {}\nname: {}\nparent_id: {}\nnotes: {:?}\n",
    self.id,
    self.name,
    self.parent_id,
    self.notes,
    )
    }
    }
  • edit in src/response.rs at line 70
    [2.4040]
    [2.4040]
    impl fmt::Display for CategorySeries {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    let mut s = String::new();
    for (i, series) in self.seriess.iter().enumerate() {
    s.push_str(&i.to_string());
    s.push('\n');
    s.push_str(&series.to_string());
    s.push('\n');
    };
    write!(f, "{}", s)
    }
    }
  • edit in src/response.rs at line 252
    [2.10034]
    [2.10034]
    impl fmt::Display for TagItem {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    write!(f,
    "name: {}\ngroup_id: {}\nnotes: {:?}\n",
    self.name,
    self.group_id,
    self.notes,
    )
    }
    }
  • edit in src/response.rs at line 459
    [2.17351]
    [2.17351]
    }
    impl fmt::Display for SeriesTags {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    let mut s = String::new();
    for (i, tags) in self.tags.iter().enumerate() {
    s.push_str(&i.to_string());
    s.push('\n');
    s.push_str(&tags.to_string());
    s.push('\n');
    };
    write!(f, "{}", s)
    }
  • replacement in src/response.rs at line 545
    [2.20181][2.20181:20213]()
    for tag in &self.tags {
    [2.20181]
    [2.20213]
    for (i, tag) in self.tags.iter().enumerate() {
    tags.push_str(&i.to_string());
    tags.push('\n');
  • edit in src/response.rs at line 569
    [2.20883]
    [2.20883]
    impl TagsSeries {
    pub fn series_titles(&self) -> String {
    let mut s = String::new();
    for series in &self.seriess {
    s.push_str(&series.title);
    s.push('\n');
    }
    s
    }
    }