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/58d8934f5550910a19d02afd420ea2cdbdf299f1 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()); }