build-your-own-jira-with-rust icon indicating copy to clipboard operation
build-your-own-jira-with-rust copied to clipboard

(01) Ticket - Validation

Open ghost opened this issue 4 years ago • 1 comments
trafficstars

hello,

Im now looking at this part

/// So far we have allowed any string as a valid title and description.
/// That's not what would happen in JIRA: we wouldn't allow tickets with an empty title,
/// for example.
/// Both title and description would also have length limitations: the Divine Comedy probably
/// shouldn't be allowed as a ticket description.
///
/// We want to define a function that takes in a title, a description and a status and
/// performs validation: it panics if validation fails, it returns a `Ticket` if validation
/// succeeds.
///
/// We will learn a better way to handle recoverable errors such as this one further along,
/// but let's rely on panic for the time being.
fn create_ticket(title: String, description: String, status: Status) -> Ticket {
                                                                             todo!()
                                                                                    }
                                                                                    ````

What am I suppose to do ?

and how do I know what a valid title and description is ?

ghost avatar Nov 11 '21 16:11 ghost