From e108a1875e1d991790f24466cb36fe07b633b560 Mon Sep 17 00:00:00 2001 From: giulio-Joshi Date: Wed, 26 Oct 2022 19:52:58 +0200 Subject: [PATCH] Fixing requested changes * Documentation consistency * Method inlining --- README.md | 5 +---- src/args.rs | 2 +- src/ascii_processor.rs | 1 + 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bc6ee9c..bca6ae6 100644 --- a/README.md +++ b/README.md @@ -106,10 +106,7 @@ Options: [default: 4] -w, --width - Width expressed as text-columns, this parameter will calculate the scale factor for you. - Overrides `scale` parameter even when specified. - - [default: disabled] + Enstablish how much wide is the output images, in columns. Overrides `scale` -b, --background The background color to use diff --git a/src/args.rs b/src/args.rs index 8a9d673..88ff59f 100644 --- a/src/args.rs +++ b/src/args.rs @@ -19,7 +19,7 @@ pub mod args { /// The output scale (1 is the original size) #[arg(short, long, default_value = "4")] pub scale: u32, - // Enstablish how much wide is the output images, in columns. Overrides `scale` + /// Enstablish how much wide is the output images, in columns. Overrides `scale` #[arg(short, long, default_value= None )] pub width: Option, /// The background color to use diff --git a/src/ascii_processor.rs b/src/ascii_processor.rs index 2a88560..7c61fc8 100644 --- a/src/ascii_processor.rs +++ b/src/ascii_processor.rs @@ -66,6 +66,7 @@ fn get_character( /// Determine how much scale to use in presence of `width` parameters, /// otherwise returns regular `scale` parameter per default behaviour /// +#[inline] fn calculate_scale(args: &Arguments, dimensions: (u32, u32)) -> u32 { args.width.map_or_else(|| args.scale, |v| dimensions.0 / v) }