Created
October 18, 2021 21:11
-
-
Save noxasaxon/ebed4396d64cc6f740804ad6134e7467 to your computer and use it in GitHub Desktop.
doctest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// ``` | |
/// 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