Closed because #5 was merged for this issue instead.
Fixed the greeting function to properly handle empty and whitespace-only names. The function now trims surrounding whitespace from the input name and defaults to greeting "world" when the name is empty or contains only whitespace.
Changes:
greeting() in src/lib.rs to trim the input and check if it's emptyThe issue where hello "" printed Hello, ! and hello " " printed Hello, ! is now resolved—both now correctly print Hello, world!
Sign in to comment.