Skip to content

Commit

Permalink
Bump the minor-changes group with 1 update (#48)
Browse files Browse the repository at this point in the history
Bumps the minor-changes group with 1 update:
[serde](https://github.com/serde-rs/serde).

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Ostrovski <[email protected]>
  • Loading branch information
dependabot[bot] and slowli committed Nov 25, 2023
1 parent 2d066f5 commit e5bbc77
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ impl Name {
/// Use the [`FromStr`] implementation for a fallible / non-panicking alternative.
pub const fn new(name: &str) -> Self {
let bytes = name.as_bytes();
assert!(
bytes.len() <= SALT_LEN,
"name is too long (should be <=16 bytes)"
);

let mut i = 0;
let mut buffer = [0_u8; SALT_LEN];
Expand Down Expand Up @@ -660,7 +664,7 @@ mod tests {
}

#[test]
#[should_panic]
#[should_panic(expected = "name contains a null char")]
fn name_with_null_chars_cannot_be_created() {
let _name = Name::new("some\0name");
}
Expand All @@ -672,7 +676,7 @@ mod tests {
}

#[test]
#[should_panic]
#[should_panic(expected = "name is too long")]
fn overly_long_name_cannot_be_created() {
let _name = Name::new("Overly long name?");
}
Expand Down

0 comments on commit e5bbc77

Please sign in to comment.