Skip to content

Update from_into exercise to use error handling instead of default value#2297

Open
iaadi4 wants to merge 1 commit intorust-lang:mainfrom
iaadi4:from_into-error-handling
Open

Update from_into exercise to use error handling instead of default value#2297
iaadi4 wants to merge 1 commit intorust-lang:mainfrom
iaadi4:from_into-error-handling

Conversation

@iaadi4
Copy link

@iaadi4 iaadi4 commented Oct 2, 2025

closes #2225

…lues

- Replace From<&str> trait with TryFrom<&str> for proper error handling
- Add ParsePersonError enum with BadLen, NoName, and ParseInt variants
- Update all tests to expect appropriate errors instead of default Person values
- Maintain same error handling pattern as from_str exercise
- Add required imports for TryFrom and TryInto traits
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect answer passed in from_into.rs

1 participant