Closed chris-olszewski closed 2 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
examples-nonmonorepo | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Sep 3, 2024 7:18pm |
Description
Remove
read_existing_to_string_or
in favor ofread_existing_to_string
to consolidate on the more Rust-y API for reading a path to a file.read_existing_to_string_or
is an awkward API due:Result<impl Into<String>, io::Error>
.impl Into<String>
was chosen so unnecessary work could be avoided. This is limiting compared toFnOnce() -> String
.Option
APIThe benefits of not conflating the two outcomes is best displayed when trying to read a config file. Instead of defaulting having a default of
{}
and then parsing it as JSON we can skip the parse and just useConfigurationOptions::default()
Testing Instructions
Existing unit tests + 👀