Chris Morgan
›
Git
›
verhoeff
› blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
commit
grep
author
committer
pickaxe
?
search:
re
Mark push_verhoeff_check_digit as panicky
[verhoeff]
/
src
/
lib.rs
diff --git
a/src/lib.rs
b/src/lib.rs
index 251edd858380e80d2fb6c44b320370640cd40650..9dd8bf7a19b665c75b57b3ce023cd786508e59ea 100644
(file)
--- a/
src/lib.rs
+++ b/
src/lib.rs
@@
-145,6
+145,9
@@
pub trait VerhoeffMut {
/// assert_eq!(digits, "123451");
/// # }
/// ```
/// 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);
}
fn push_verhoeff_check_digit(&mut self);
}
@@
-167,6
+170,9
@@
impl VerhoeffMut for alloc::vec::Vec<u8> {
/// digits.push_verhoeff_check_digit();
/// assert_eq!(digits, [1, 2, 3, 4, 5, 1]);
/// ```
/// 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());
}
fn push_verhoeff_check_digit(&mut self) {
self.push(self.calculate_verhoeff_check_digit());
}