100-exercises-to-learn-rust/helpers/ticket_fields/src/test_helpers.rs

15 lines
419 B
Rust
Raw Normal View History

2024-05-13 04:21:03 +08:00
use crate::{TicketDescription, TicketTitle};
use common::{valid_description, valid_title};
/// A function to generate a valid ticket title,
/// for test purposes.
pub fn ticket_title() -> TicketTitle {
valid_title().try_into().unwrap()
}
/// A function to generate a valid ticket description,
/// for test purposes.
pub fn ticket_description() -> TicketDescription {
valid_description().try_into().unwrap()
}