Skip to content

Commit

Permalink
Update to Rust 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
sondr3 committed Dec 27, 2018
1 parent 3b441d6 commit 27937ac
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 20 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "git-anger-management"
version = "0.5.1"
edition = "2018"
authors = ["Sondre Nilsen <nilsen.sondre@gmail.com>"]
description = "Count your naughty words in git commit messages"
repository = "https://github.com/sondr3/git-anger-management"
Expand Down
12 changes: 3 additions & 9 deletions src/bin.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
extern crate git2;
extern crate git_anger_management as gam;
extern crate indicatif;
extern crate structopt;

use gam::Repo;
use gam::{naughty_word, split_into_clean_words};
use git2::{Commit, Repository};
use git_anger_management::{naughty_word, split_into_clean_words, Repo};
use indicatif::{ProgressBar, ProgressStyle};
use std::env;
use std::error::Error;
Expand Down Expand Up @@ -33,7 +27,7 @@ struct Cli {
directory: Option<PathBuf>,
}

pub fn main() -> Result<(), Box<Error>> {
pub fn main() -> Result<(), Box<dyn Error>> {
let start = Instant::now();
let opt = Cli::from_args();
let path = match opt.directory {
Expand Down Expand Up @@ -101,7 +95,7 @@ pub fn main() -> Result<(), Box<Error>> {
}

println!("{}", repo);
for mut author in repo.authors.values() {
for author in repo.authors.values() {
if author.is_naughty() {
println!("{}", author);
}
Expand Down
1 change: 1 addition & 0 deletions src/core.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use hashbrown::HashSet;
use lazy_static::lazy_static;

pub static CURSES_FILE: &str = include_str!("words.txt");
lazy_static! {
Expand Down
14 changes: 4 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,20 @@
//!
//! Or look at the help by running `git anger-management -h`.
#![cfg_attr(feature = "fail-on-warnings", deny(warnings))]
#![cfg_attr(feature = "cargo-clippy", deny(clippy))]
#![forbid(unsafe_code)]
#![deny(
clippy::all,
missing_docs,
missing_debug_implementations,
missing_copy_implementations,
trivial_casts,
unused_import_braces,
unused_allocation
)]

#[macro_use]
extern crate lazy_static;
extern crate hashbrown;
extern crate indicatif;

mod author;
mod core;
mod repo;

pub use author::Author;
pub use core::{naughty_word, split_into_clean_words};
pub use repo::Repo;
pub use crate::author::Author;
pub use crate::core::{naughty_word, split_into_clean_words};
pub use crate::repo::Repo;
2 changes: 1 addition & 1 deletion src/repo.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use author::Author;
use crate::author::Author;
use hashbrown::HashMap;
use std::fmt;

Expand Down

0 comments on commit 27937ac

Please sign in to comment.