Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle failing to read code file more gracefully #36

Merged
merged 2 commits into from
Nov 29, 2024

Conversation

faern
Copy link
Member

@faern faern commented Nov 29, 2024

This essentially replaces fs::read_to_string(path).unwrap(); with better error handling. Reading a source code file might fail for a number of reasons, including but not limited to missing permissions and not valid UTF-8 content.

The only error for now is failing to read the code file. But the types
allow expanding on this later
@faern faern force-pushed the handle-non-utf-8-files-gracefully branch from c421bb1 to e2043d1 Compare November 29, 2024 13:18
README.md Outdated Show resolved Hide resolved
@faern faern merged commit 6a251ea into main Nov 29, 2024
12 checks passed
@faern faern deleted the handle-non-utf-8-files-gracefully branch November 29, 2024 13:50
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.

2 participants