error messages end in periods

This commit is contained in:
ConnorSkees 2020-03-23 12:53:55 -04:00
parent 01c1cf3bb3
commit 795c8bdb05
2 changed files with 12 additions and 12 deletions

View File

@ -32,19 +32,19 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
let lightness = match channels.pop() {
Some(Value::Dimension(n, _)) => n / Number::from(100),
Some(v) => return Err(format!("$lightness: {} is not a number", v).into()),
Some(v) => return Err(format!("$lightness: {} is not a number.", v).into()),
None => return Err("Missing element $lightness.".into()),
};
let saturation = match channels.pop() {
Some(Value::Dimension(n, _)) => n / Number::from(100),
Some(v) => return Err(format!("$saturation: {} is not a number", v).into()),
Some(v) => return Err(format!("$saturation: {} is not a number.", v).into()),
None => return Err("Missing element $saturation.".into()),
};
let hue = match channels.pop() {
Some(Value::Dimension(n, _)) => n,
Some(v) => return Err(format!("$hue: {} is not a number", v).into()),
Some(v) => return Err(format!("$hue: {} is not a number.", v).into()),
None => return Err("Missing element $hue.".into()),
};
@ -110,19 +110,19 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
let lightness = match channels.pop() {
Some(Value::Dimension(n, _)) => n / Number::from(100),
Some(v) => return Err(format!("$lightness: {} is not a number", v).into()),
Some(v) => return Err(format!("$lightness: {} is not a number.", v).into()),
None => return Err("Missing element $lightness.".into()),
};
let saturation = match channels.pop() {
Some(Value::Dimension(n, _)) => n / Number::from(100),
Some(v) => return Err(format!("$saturation: {} is not a number", v).into()),
Some(v) => return Err(format!("$saturation: {} is not a number.", v).into()),
None => return Err("Missing element $saturation.".into()),
};
let hue = match channels.pop() {
Some(Value::Dimension(n, _)) => n,
Some(v) => return Err(format!("$hue: {} is not a number", v).into()),
Some(v) => return Err(format!("$hue: {} is not a number.", v).into()),
None => return Err("Missing element $hue.".into()),
};

View File

@ -34,7 +34,7 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
Some(Value::Dimension(n, Unit::Percent)) => {
(n / Number::from(100)) * Number::from(255)
}
Some(v) => return Err(format!("$blue: {} is not a number", v).into()),
Some(v) => return Err(format!("$blue: {} is not a number.", v).into()),
None => return Err("Missing element $blue.".into()),
};
@ -43,7 +43,7 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
Some(Value::Dimension(n, Unit::Percent)) => {
(n / Number::from(100)) * Number::from(255)
}
Some(v) => return Err(format!("$green: {} is not a number", v).into()),
Some(v) => return Err(format!("$green: {} is not a number.", v).into()),
None => return Err("Missing element $green.".into()),
};
@ -52,7 +52,7 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
Some(Value::Dimension(n, Unit::Percent)) => {
(n / Number::from(100)) * Number::from(255)
}
Some(v) => return Err(format!("$red: {} is not a number", v).into()),
Some(v) => return Err(format!("$red: {} is not a number.", v).into()),
None => return Err("Missing element $red.".into()),
};
@ -156,7 +156,7 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
Some(Value::Dimension(n, Unit::Percent)) => {
(n / Number::from(100)) * Number::from(255)
}
Some(v) => return Err(format!("$blue: {} is not a number", v).into()),
Some(v) => return Err(format!("$blue: {} is not a number.", v).into()),
None => return Err("Missing element $blue.".into()),
};
@ -165,7 +165,7 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
Some(Value::Dimension(n, Unit::Percent)) => {
(n / Number::from(100)) * Number::from(255)
}
Some(v) => return Err(format!("$green: {} is not a number", v).into()),
Some(v) => return Err(format!("$green: {} is not a number.", v).into()),
None => return Err("Missing element $green.".into()),
};
@ -174,7 +174,7 @@ pub(crate) fn register(f: &mut HashMap<String, Builtin>) {
Some(Value::Dimension(n, Unit::Percent)) => {
(n / Number::from(100)) * Number::from(255)
}
Some(v) => return Err(format!("$red: {} is not a number", v).into()),
Some(v) => return Err(format!("$red: {} is not a number.", v).into()),
None => return Err("Missing element $red.".into()),
};