From 58d8934f5550910a19d02afd420ea2cdbdf299f1 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Fri, 7 Jan 2022 15:53:28 +1100 Subject: [PATCH] Mark push_verhoeff_check_digit as panicky A very minor omission. --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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()); } -- 2.42.0