diff options
author | Nicholas Johnson <nick@nicholasjohnson.ch> | 2024-04-21 00:00:00 +0000 |
---|---|---|
committer | Nicholas Johnson <nick@nicholasjohnson.ch> | 2024-04-21 00:00:00 +0000 |
commit | 4e042126bd9f250fc84a00fa34de90cc48d15ccf9715a72ef465669313331252 (patch) | |
tree | f5dee1ff90390ab1b6f101467695ba16a99c3a66d40515c3174ce2661f86e956 /src | |
parent | d901633c75773ffaa8a1eb01cc9539e3f79b3924613e5c89d5f4b0236acf5d7e (diff) | |
download | hitomezashi-rs-4e042126bd9f250fc84a00fa34de90cc48d15ccf9715a72ef465669313331252.tar.gz hitomezashi-rs-4e042126bd9f250fc84a00fa34de90cc48d15ccf9715a72ef465669313331252.zip |
Make hitomezashi_rs a proper library cratev3.0.0
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs (renamed from src/hitomezashi.rs) | 2 | ||||
-rw-r--r-- | src/main.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/hitomezashi.rs b/src/lib.rs index 8e2a773..9f8643e 100644 --- a/src/hitomezashi.rs +++ b/src/lib.rs @@ -32,7 +32,7 @@ fn print_square(is_opaque: bool) { ); } -pub fn hitomezashi(width: usize, height: usize, skew: Option<f64>) { +pub fn generate(width: usize, height: usize, skew: Option<f64>) { // skew=0.5 generates the most random-looking patterns let skew: f64 = skew.unwrap_or(0.5); diff --git a/src/main.rs b/src/main.rs index 0aba5f0..c936dc1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,7 +19,7 @@ use clap::Parser; use std::ops::RangeInclusive; -mod hitomezashi; +use hitomezashi_rs; #[derive(Parser)] #[command(version, about, long_about = None)] // Read from `Cargo.toml` @@ -43,7 +43,7 @@ struct Cli { fn main() { let cli = Cli::parse(); - hitomezashi::hitomezashi(cli.width, cli.height, Some(cli.skew)); + hitomezashi_rs::generate(cli.width, cli.height, Some(cli.skew)); } const DIMENSION_RANGE: RangeInclusive<usize> = 1..=std::usize::MAX; |