Use "bytes" instead of "characters" consistently when talking about length of a String.
This commit is contained in:
@@ -43,7 +43,7 @@ impl Ticket {
|
||||
}
|
||||
if title.len() > 50 {
|
||||
return Err(TicketNewError::TitleError(
|
||||
"Title cannot be longer than 50 characters".to_string(),
|
||||
"Title cannot be longer than 50 bytes".to_string(),
|
||||
));
|
||||
}
|
||||
if description.is_empty() {
|
||||
@@ -53,7 +53,7 @@ impl Ticket {
|
||||
}
|
||||
if description.len() > 500 {
|
||||
return Err(TicketNewError::DescriptionError(
|
||||
"Description cannot be longer than 500 characters".to_string(),
|
||||
"Description cannot be longer than 500 bytes".to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[should_panic(expected = "Title cannot be longer than 50 characters")]
|
||||
#[should_panic(expected = "Title cannot be longer than 50 bytes")]
|
||||
fn title_cannot_be_longer_than_fifty_chars() {
|
||||
easy_ticket(overly_long_title(), valid_description(), Status::ToDo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user