Fixing requested changes

* Documentation consistency
* Method inlining
This commit is contained in:
giulio-Joshi 2022-10-26 19:52:58 +02:00
parent 0933e157d5
commit e108a1875e
3 changed files with 3 additions and 5 deletions

View File

@ -106,10 +106,7 @@ Options:
[default: 4]
-w, --width <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 <BACKGROUND>
The background color to use

View File

@ -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<u32>,
/// The background color to use

View File

@ -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)
}