Skip to content

Instantly share code, notes, and snippets.

@noxasaxon
Created October 18, 2021 21:11
Show Gist options
  • Save noxasaxon/ebed4396d64cc6f740804ad6134e7467 to your computer and use it in GitHub Desktop.
Save noxasaxon/ebed4396d64cc6f740804ad6134e7467 to your computer and use it in GitHub Desktop.
doctest
/// ```
/// use ex01::list_of_plastic;
///
/// assert_eq!(list_of_plastic("Polyethylene Terephthalate"), Some("Polyethylene Terephthalate"));
/// assert_eq!(list_of_plastic("not a plastic"), None);
/// assert_eq!(list_of_plastic("Polyvinyl Chloride"), Some("Polyvinyl Chloride"));
/// ```
pub fn list_of_plastic(plastic: &str) -> Option<&str> {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment