Skip to content

Commit d9f5571

Browse files
committed
Restructure app a bit
1 parent 8358880 commit d9f5571

File tree

6 files changed

+12
-25
lines changed

6 files changed

+12
-25
lines changed

Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,11 @@ categories = ["command-line-utilities"]
1414

1515
[[bin]]
1616
name = "git-anger-management"
17-
path = "src/bin.rs"
17+
path = "src/bin/main.rs"
1818

1919
[profile.release]
2020
lto = "thin"
2121

22-
[features]
23-
fail-on-warnings = []
24-
2522
[dependencies]
2623
structopt = "0.3.14"
2724
prettytable-rs = "0.8.0"

src/bin.rs renamed to src/bin/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use console::Term;
22
use git2::Repository;
3-
use git_anger_management::Repo;
3+
use git_anger_management::repo::Repo;
44
use std::env;
55
use std::error::Error;
66
use std::path::PathBuf;

src/core.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use once_cell::sync::OnceCell;
22
use std::collections::HashSet;
33

4+
/// Statically include the word list for curse words
45
pub static CURSES_FILE: &str = include_str!("words.txt");
6+
57
fn curses() -> &'static HashSet<&'static str> {
68
static INSTANCE: OnceCell<HashSet<&'static str>> = OnceCell::new();
79
INSTANCE.get_or_init(|| CURSES_FILE.lines().collect())

src/lib.rs

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,9 @@
6969
//!
7070
//! Or look at the help by running `git anger-management -h`.
7171
#![doc(html_root_url = "https://docs.rs/git-anger-management/0.6.0")]
72-
#![cfg_attr(feature = "fail-on-warnings", deny(warnings))]
73-
#![forbid(unsafe_code)]
74-
#![deny(
75-
clippy::all,
76-
missing_docs,
77-
missing_debug_implementations,
78-
missing_copy_implementations,
79-
trivial_casts,
80-
unused_import_braces,
81-
unused_allocation
82-
)]
83-
mod author;
84-
mod core;
85-
mod repo;
86-
87-
pub use crate::author::Author;
88-
pub use crate::core::{naughty_word, split_into_clean_words};
89-
pub use crate::repo::Repo;
72+
/// A git author
73+
pub mod author;
74+
/// Core algorithms and functionality
75+
pub mod core;
76+
/// A simplified representation of a git repository
77+
pub mod repo;

src/repo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::author::Author;
2-
use crate::{naughty_word, split_into_clean_words};
2+
use crate::core::{naughty_word, split_into_clean_words};
33
use git2::{Commit, Repository};
44
use prettytable::{format, Cell, Row, Table};
55
use std::collections::HashMap;

tests/repo_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use git2::Repository;
2-
use git_anger_management::Repo;
2+
use git_anger_management::repo::Repo;
33
use std::path::{Path, PathBuf};
44

55
#[test]

0 commit comments

Comments
 (0)