Use "bytes" instead of "characters" consistently when talking about length of a String.
This commit is contained in:
@@ -5,7 +5,7 @@ pub struct TicketDescription(String);
|
||||
pub enum TicketDescriptionError {
|
||||
#[error("The description cannot be empty")]
|
||||
Empty,
|
||||
#[error("The description cannot be longer than 500 characters")]
|
||||
#[error("The description cannot be longer than 500 bytes")]
|
||||
TooLong,
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ mod tests {
|
||||
let err = TicketDescription::try_from(overly_long_description()).unwrap_err();
|
||||
assert_eq!(
|
||||
err.to_string(),
|
||||
"The description cannot be longer than 500 characters"
|
||||
"The description cannot be longer than 500 bytes"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ pub struct TicketTitle(String);
|
||||
pub enum TicketTitleError {
|
||||
#[error("The title cannot be empty")]
|
||||
Empty,
|
||||
#[error("The title cannot be longer than 50 characters")]
|
||||
#[error("The title cannot be longer than 50 bytes")]
|
||||
TooLong,
|
||||
}
|
||||
|
||||
@@ -61,10 +61,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_try_from_long_string() {
|
||||
let err = TicketTitle::try_from(overly_long_title()).unwrap_err();
|
||||
assert_eq!(
|
||||
err.to_string(),
|
||||
"The title cannot be longer than 50 characters"
|
||||
);
|
||||
assert_eq!(err.to_string(), "The title cannot be longer than 50 bytes");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user