Skip to content

Commit

Permalink
chore: Cleaned up and grouped modules better
Browse files Browse the repository at this point in the history
  • Loading branch information
max-ishere committed Jan 27, 2024
1 parent 058017c commit 5da62f7
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion examples/pff2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::fs::read;

use args::Args;
use clap::Parser as _;
use theme_parser::pff2::Parser;
use theme_parser::parser::pff2::Parser;

mod args {
use std::path::PathBuf;
Expand Down
2 changes: 1 addition & 1 deletion examples/theme_txt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{fs::read_to_string, sync::Arc};
use args::Args;
use clap::Parser;
use nom::{error::Error, Finish};
use theme_parser::theme_txt::Document;
use theme_parser::parser::theme_txt::Document;

mod args {
use std::path::PathBuf;
Expand Down
9 changes: 0 additions & 9 deletions src/args.rs

This file was deleted.

13 changes: 8 additions & 5 deletions src/main.rs → src/bin/main.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
use std::{fs::read_to_string, sync::Arc};

use args::Args;
use clap::Parser;
use nom::{error::Error, Finish};
use theme_parser::theme_txt::Document;
use std::{fs::read_to_string, path::PathBuf, sync::Arc};

use theme_parser::parser::theme_txt::Document;

mod args;
#[derive(Parser)]
pub struct Args {
#[clap(long, short = 'f')]
pub theme_file: PathBuf,
}

fn main() -> anyhow::Result<()> {
let args = Args::parse();
Expand Down
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ extern crate test_case;

extern crate thiserror;

pub mod pff2;
pub mod theme_txt;
pub mod parser {
pub mod pff2;
pub mod theme_txt;
}

pub type OwnedSlice<T> = Rc<T>;
File renamed without changes.
2 changes: 1 addition & 1 deletion src/theme_txt.rs → src/parser/theme_txt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! statements, each is either a [`Component`] or a [`GlobalProperty`].
//!
//! ```rust
//! # use theme_parser::theme_txt::*;
//! # use theme_parser::parser::theme_txt::*;
//! let theme_txt = r#"# your average theme file
//!
//! terminal-font: "Monospace"
Expand Down

0 comments on commit 5da62f7

Please sign in to comment.