From: Chris Morgan Date: Fri, 7 Jan 2022 04:53:28 +0000 (+1100) Subject: Mark push_verhoeff_check_digit as panicky X-Git-Url: https://git.chrismorgan.info/verhoeff/commitdiff_plain/HEAD?hp=95453055eda4d3f730a2ce90d9fd3d61c789e9c5 Mark push_verhoeff_check_digit as panicky A very minor omission. --- diff --git a/src/lib.rs b/src/lib.rs index 251edd8..9dd8bf7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -145,6 +145,9 @@ pub trait VerhoeffMut { /// assert_eq!(digits, "123451"); /// # } /// ``` + /// + /// Because this calls [`Verhoeff::calculate_verhoeff_check_digit`], + /// it will panic if the input is not comprised of appropriate digits. fn push_verhoeff_check_digit(&mut self); } @@ -167,6 +170,9 @@ impl VerhoeffMut for alloc::vec::Vec { /// digits.push_verhoeff_check_digit(); /// assert_eq!(digits, [1, 2, 3, 4, 5, 1]); /// ``` + /// + /// Because this calls [`Verhoeff::calculate_verhoeff_check_digit`], + /// it will panic if the input is not comprised of appropriate digits. fn push_verhoeff_check_digit(&mut self) { self.push(self.calculate_verhoeff_check_digit()); }