Home / Function/ main() — tailwindcss Function Reference

main() — tailwindcss Function Reference

Architecture documentation for the main() function in walk.rs from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  03b831f2_a4e3_4cca_3247_f4ffaab29a71["main()"]
  56be66cb_5590_b90e_770f_a1ed468a4478["walk.rs"]
  03b831f2_a4e3_4cca_3247_f4ffaab29a71 -->|defined in| 56be66cb_5590_b90e_770f_a1ed468a4478
  7f51f336_6536_f522_8672_738411455c1e["path()"]
  03b831f2_a4e3_4cca_3247_f4ffaab29a71 -->|calls| 7f51f336_6536_f522_8672_738411455c1e
  style 03b831f2_a4e3_4cca_3247_f4ffaab29a71 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

crates/ignore/examples/walk.rs lines 5–52

fn main() {
    let mut path = env::args().nth(1).unwrap();
    let mut parallel = false;
    let mut simple = false;
    let (tx, rx) = crossbeam_channel::bounded::<DirEntry>(100);
    if path == "parallel" {
        path = env::args().nth(2).unwrap();
        parallel = true;
    } else if path == "walkdir" {
        path = env::args().nth(2).unwrap();
        simple = true;
    }

    let stdout_thread = std::thread::spawn(move || {
        let mut stdout = std::io::BufWriter::new(std::io::stdout());
        for dent in rx {
            stdout
                .write_all(&Vec::from_path_lossy(dent.path()))
                .unwrap();
            stdout.write_all(b"\n").unwrap();
        }
    });

    if parallel {
        let walker = WalkBuilder::new(path).threads(6).build_parallel();
        walker.run(|| {
            let tx = tx.clone();
            Box::new(move |result| {
                use ignore::WalkState::*;

                tx.send(DirEntry::Y(result.unwrap())).unwrap();
                Continue
            })
        });
    } else if simple {
        let walker = WalkDir::new(path);
        for result in walker {
            tx.send(DirEntry::X(result.unwrap())).unwrap();
        }
    } else {
        let walker = WalkBuilder::new(path).build();
        for result in walker {
            tx.send(DirEntry::Y(result.unwrap())).unwrap();
        }
    }
    drop(tx);
    stdout_thread.join().unwrap();
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does main() do?
main() is a function in the tailwindcss codebase, defined in crates/ignore/examples/walk.rs.
Where is main() defined?
main() is defined in crates/ignore/examples/walk.rs at line 5.
What does main() call?
main() calls 1 function(s): path.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free