From 743e375f5b1a3923d83381147333654227c1dc9b Mon Sep 17 00:00:00 2001 From: Severin Siffert Date: Thu, 23 Nov 2023 11:43:54 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Thomas Locher --- CHANGELOG.md | 4 ++-- src/dfx/src/util/clap/parsers.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79df0c0463..a5a7d2f1ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,9 +38,9 @@ The message "transaction is a duplicate of another transaction in block ...", pr ### feat: accept more ways to specify cycle and e8s amounts -`_` can now be to make large numbers more readable. For example: `dfx canister deposit-cycles 1_234_567 mycanister` +Underscores (`_`) can now be used to make large numbers more readable. For example: `dfx canister deposit-cycles 1_234_567 mycanister` -Certain suffixes that replace a number of zeros are now supported. The (case insensiteve) suffixes are: +Certain suffixes that replace a number of zeros are now supported. The (case-insensitive) suffixes are: - `k` for `000`, e.g. `500k` - `m` for `000_000`, e.g. `5m` - `b` for `000_000_000`, e.g. `50B` diff --git a/src/dfx/src/util/clap/parsers.rs b/src/dfx/src/util/clap/parsers.rs index 0b9f918405..0dbe392116 100644 --- a/src/dfx/src/util/clap/parsers.rs +++ b/src/dfx/src/util/clap/parsers.rs @@ -2,7 +2,7 @@ use byte_unit::{Byte, ByteUnit}; use rust_decimal::Decimal; use std::{path::PathBuf, str::FromStr}; -/// Removes `_`, interprets `k`, `m`, `b`, `t` suffix (case insensitive) +/// Removes `_`, interprets `k`, `m`, `b`, `t` suffix (case-insensitive) fn decimal_with_suffix_parser(input: &str) -> Result { let input = input.replace("_", "").to_lowercase(); let (number, suffix) = if input @@ -49,7 +49,7 @@ pub fn request_id_parser(v: &str) -> Result { pub fn e8s_parser(input: &str) -> Result { decimal_with_suffix_parser(input)? .try_into() - .map_err(|_| "Must specify a non negative whole number.".to_string()) + .map_err(|_| "Must specify a non-negative whole number.".to_string()) } pub fn memo_parser(memo: &str) -> Result {