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

Minor docfixes in read_bytes! and read_utf8! #304

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions platform/File.roc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ delete! = \path ->
##
## This opens the file first and closes it after reading its contents.
##
## > To read and decode data from a file, you can use `File.read` instead.
## > To read and decode data from a file into a [Str], you can use [File.read_utf8!] instead.
## >
## > [Path.read_bytes!] does the same thing, except it takes a [Path] instead of a [Str].
read_bytes! : Str => Result (List U8) [FileReadErr Path IOErr]
Expand All @@ -146,7 +146,7 @@ read_bytes! = \path ->
## File.read_utf8! "myfile.txt"
## ```
##
## This opens the file first and closes it after writing to it.
## This opens the file first and closes it after reading its contents.
## The task will fail with `FileReadUtf8Err` if the given file contains invalid UTF-8.
##
## > To read unformatted bytes from a file, you can use [File.read_bytes!] instead.
Expand Down
4 changes: 2 additions & 2 deletions platform/Path.roc
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ delete! = \path ->
## Path.read_utf8 (Path.from_str "myfile.txt")
## ```
##
## This opens the file first and closes it after writing to it.
## This opens the file first and closes it after reading its contents.
## The task will fail with `FileReadUtf8Err` if the given file contains invalid UTF-8.
##
## > To read unformatted bytes from a file, you can use [Path.read_bytes!] instead.
Expand All @@ -318,7 +318,7 @@ read_utf8! = \path ->
##
## This opens the file first and closes it after reading its contents.
##
## > To read and decode data from a file, you can use `Path.read` instead.
## > To read and decode data from a file into a [Str], you can use [Path.read_utf8!] instead.
## >
## > [`File.read_bytes`](File#read_bytes!) does the same thing, except it takes a [Str] instead of a [Path].
read_bytes! : Path => Result (List U8) [FileReadErr Path IOErr]
Expand Down
Loading