Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename lib.rs to tree_parser.rs #20

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ pub struct FilteredIterator {
}

impl FilteredIterator {
// I have no idea why this is considered dead_code by rustc.
#[allow(dead_code)]
pub fn new(iterator: FileIterator) -> Self {
FilteredIterator {
source: iterator,
Expand All @@ -21,8 +19,6 @@ impl FilteredIterator {
}
}

// I have no idea why this is considered dead_code by rustc.
#[allow(dead_code)]
pub fn skip_filter(&mut self) {
self.skip = true;
}
Expand Down
12 changes: 8 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#![deny(clippy::pedantic)]
#![deny(clippy::all)]

mod filter;
mod pathiterator;
mod tree_printer;

#[cfg(test)]
mod tests;

use clap::Parser;
use tree_rs::{Config, TreePrinter};
use tree_printer::{Config, TreePrinter};

use std::error::Error;
use std::io::{self, Write};
Expand All @@ -11,9 +18,6 @@ use std::path::Path;
use globset::Glob;
use term::TerminfoTerminal;

mod filter;
mod pathiterator;

#[derive(Debug, Parser)]
struct Args {
/// Show hidden files
Expand Down
2 changes: 0 additions & 2 deletions src/pathiterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ fn get_sorted_dir_entries(path: &Path) -> io::Result<Vec<DirEntry>> {
}

impl FileIterator {
// I have no idea why this is considered dead_code by rustc.
#[allow(dead_code)]
pub fn new(path: &Path, config: FileIteratorConfig) -> FileIterator {
let mut queue = VecDeque::new();
queue.push_back(IteratorItem::new(path, 0, true));
Expand Down
2 changes: 2 additions & 0 deletions src/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mod test_simple;
mod utils;
6 changes: 2 additions & 4 deletions tests/test_simple.rs → src/tests/test_simple.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
mod test_terminal;

use std::fs::create_dir_all;
use std::path::Path;

use crate::tests::utils::TestTerminal;
use crate::{tree_printer::DirEntrySummary, Config, TreePrinter};
use globset::Glob;
use test_terminal::TestTerminal;
use tree_rs::{Config, DirEntrySummary, TreePrinter};

fn run_cmd(path: &Path, config: Config) -> (String, DirEntrySummary) {
let mut writer = TestTerminal::new();
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions src/lib.rs → src/tree_printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ use std::path::Path;
use globset::GlobMatcher;
use term::{color, Terminal};

mod filter;
mod pathiterator;
use crate::{filter, pathiterator};

mod dirsign {
pub const HORZ: char = '─';
Expand Down