pub struct Repo {
pub name: String,
pub total_commits: usize,
pub total_curses: usize,
pub curses: HashMap<String, usize>,
pub authors: HashMap<String, Author>,
}
Expand description
A simple representation of a git repository.
Fields§
§name: String
Name of the repository.
total_commits: usize
Count of the total amount of commits in the repository.
total_curses: usize
Count of the total amount of curses used in the commits.
curses: HashMap<String, usize>
HashMap of all the naughty words used by the authors.
HashMap of all the authors that have been committed.
Implementations§
Source§impl Repo
impl Repo
Checks if an author exists and creates a new author if she/he doesn’t exist.
Sourcepub fn count_curses(&mut self)
pub fn count_curses(&mut self)
Counts all the naughty words used by authors.
Sourcepub fn print_json(&self) -> Result<(), Box<dyn Error>>
pub fn print_json(&self) -> Result<(), Box<dyn Error>>
Serialize the Repo
struct into a JSON-object and print it.
Sourcepub fn print_list(&self) -> Result<(), Box<dyn Error>>
pub fn print_list(&self) -> Result<(), Box<dyn Error>>
Build a table to display naughty authors and their words.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Repo
impl RefUnwindSafe for Repo
impl Send for Repo
impl Sync for Repo
impl Unpin for Repo
impl UnwindSafe for Repo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more