Skip to content

Commit 7fd3b56

Browse files
committed
rearrange files
1 parent f9e86a0 commit 7fd3b56

File tree

13 files changed

+24
-29
lines changed

13 files changed

+24
-29
lines changed

Diff for: src/main.rs

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
11
// `error_chain!` can recurse deeply
22
#![recursion_limit = "1024"]
33

4+
use crate::onefetch::{clap_app, error::*, image_backends, info, language::Language, options};
5+
46
use {
5-
ascii_art::AsciiArt,
6-
commit_info::CommitInfo,
7-
error::*,
8-
info::Info,
9-
language::Language,
107
process::{Command, Stdio},
118
std::{convert::From, env, process, str::FromStr},
129
strum::IntoEnumIterator,
1310
};
1411

15-
mod ascii_art;
16-
mod clap_app;
17-
mod commit_info;
18-
mod error;
19-
mod image_backends;
20-
mod info;
21-
mod language;
22-
mod license;
23-
mod options;
12+
mod onefetch;
2413

2514
fn run() -> Result<()> {
2615
#[cfg(windows)]
@@ -88,7 +77,7 @@ fn run() -> Result<()> {
8877
},
8978
};
9079

91-
let info = Info::new(config)?;
80+
let info = info::Info::new(config)?;
9281

9382
print!("{}", info);
9483
Ok(())
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: src/error.rs renamed to src/onefetch/error.rs

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: src/info.rs renamed to src/onefetch/info.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
use {
2-
crate::{
3-
error::*,
4-
language::Language,
5-
license::Detector,
6-
options::Options,
7-
{AsciiArt, CommitInfo},
2+
crate::onefetch::{
3+
ascii_art::AsciiArt, commit_info::CommitInfo, error::*, language::Language,
4+
license::Detector, options::Options,
85
},
96
colored::{Color, ColoredString, Colorize},
107
git2::Repository,

Diff for: src/language.rs renamed to src/onefetch/language.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use {
2-
crate::error::*,
2+
crate::onefetch::error::*,
33
colored::Color,
44
regex::Regex,
55
std::collections::HashMap,
@@ -40,8 +40,8 @@ macro_rules! define_languages {
4040
impl Language {
4141
pub fn get_ascii_art(&self) -> &str {
4242
match *self {
43-
$( Language::$name => include_str!(concat!("../resources/", $ascii)), )*
44-
Language::Unknown => include_str!("../resources/unknown.ascii"),
43+
$( Language::$name => include_str!(concat!("../../resources/", $ascii)), )*
44+
Language::Unknown => include_str!("../../resources/unknown.ascii"),
4545
}
4646
}
4747

@@ -78,7 +78,7 @@ macro_rules! define_languages {
7878
#[test]
7979
#[ignore]
8080
fn [<$name:lower _width>] () {
81-
const ASCII: &str = include_str!(concat!("../resources/", $ascii));
81+
const ASCII: &str = include_str!(concat!("../../resources/", $ascii));
8282

8383
for (line_number, line) in ASCII.lines().enumerate() {
8484
let line = COLOR_INTERPOLATION.replace_all(line, "");
@@ -91,7 +91,7 @@ macro_rules! define_languages {
9191
#[test]
9292
#[ignore]
9393
fn [<$name:lower _height>] () {
94-
const ASCII: &str = include_str!(concat!("../resources/", $ascii));
94+
const ASCII: &str = include_str!(concat!("../../resources/", $ascii));
9595
assert_le!(ASCII.lines().count(), MAX_HEIGHT, concat!($ascii, " is too tall."));
9696
}
9797
}

Diff for: src/license.rs renamed to src/onefetch/license.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use askalono::{Store, TextData};
22

3-
use crate::error::*;
3+
use crate::onefetch::error::*;
44

5-
static CACHE_DATA: &[u8] = include_bytes!("../resources/licenses/cache.bin.zstd");
5+
static CACHE_DATA: &[u8] = include_bytes!("../../resources/licenses/cache.bin.zstd");
66
const MIN_THRESHOLD: f32 = 0.8;
77

88
pub struct Detector {

Diff for: src/onefetch/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
pub mod ascii_art;
2+
pub mod clap_app;
3+
pub mod commit_info;
4+
pub mod error;
5+
pub mod image_backends;
6+
pub mod info;
7+
pub mod language;
8+
pub mod license;
9+
pub mod options;

Diff for: src/options.rs renamed to src/onefetch/options.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use {
2-
crate::{image_backends::ImageBackend, info::InfoFieldOn, language::Language},
2+
crate::onefetch::{image_backends::ImageBackend, info::InfoFieldOn, language::Language},
33
image::DynamicImage,
44
};
55

0 commit comments

Comments
 (0)