From 520ab55756eaf56359f56944a905879170c90b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20N=2E=20Robalino?= Date: Sun, 14 Jul 2019 22:47:01 -0500 Subject: [PATCH] K raw unit is a kilobyte. --- src/parser/parse/parser.rs | 2 ++ src/parser/parse/unit.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/parser/parse/parser.rs b/src/parser/parse/parser.rs index 795b980ee..5bbd5fdfc 100644 --- a/src/parser/parse/parser.rs +++ b/src/parser/parse/parser.rs @@ -217,6 +217,8 @@ pub fn raw_unit(input: NomSpan) -> IResult> { tag("KB"), tag("kb"), tag("Kb"), + tag("K"), + tag("k"), tag("MB"), tag("mb"), tag("Mb"), diff --git a/src/parser/parse/unit.rs b/src/parser/parse/unit.rs index 78f223bd9..f8294edc4 100644 --- a/src/parser/parse/unit.rs +++ b/src/parser/parse/unit.rs @@ -46,8 +46,8 @@ impl FromStr for Unit { type Err = (); fn from_str(input: &str) -> Result::Err> { match input { - "B" | "b" => Ok(Unit::B), - "KB" | "kb" | "Kb" => Ok(Unit::KB), + "B" | "b" => Ok(Unit::B), + "KB" | "kb" | "Kb" | "K" | "k" => Ok(Unit::KB), "MB" | "mb" | "Mb" => Ok(Unit::MB), "GB" | "gb" | "Gb" => Ok(Unit::GB), "TB" | "tb" | "Tb" => Ok(Unit::TB),