You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following locations are potential candidates. These should not have a big impact on the rest of the code base, but they allow all the errors and other enums to have the same implementation strategy.
@MitchellBerend Thanks a lot for collecting all the usages of errors!
I marked this issue as blocked by #88 as the Display refactoring needs to happen first. Using Display instead of custom display() is definitely a welcome change 👏🏻
For this particular issue, it's a bit hard to evaluate whether it'll simplify the code or make it less maintainable. In theory, specifying the err_msg argument as some polymorphic type <Msg: Display> could open a road to future refactoring where we use some specialised trait for errors. E.g. std::error::Error or something from eyre.
But in any case, if refactoring proposed by this issue makes function signatures more generic and reduces usages of to_string() and display() on call sites, I'm happy to apply this refactoring 🆗
std::error::Error does not have the Display trait implemented and rust requires either the trait or the struct/enum to be defined in the crate itself, so I'm not sure if we can use that with the proposed change. Im not sure how eyre gets around this though.
The blocked label sounds like a good idea! I've created it and added it to a blocked issue.
However, this issue is no longer blocked as #88 actually was already done by @zixuanzhang-x 😅
There's no way to specify what issue is blocking inside the label text. So I propose to put the "Blocked by #NUMBER" string in the beginning of every issue that is blocked by something else.
…lements Display (#100)
Resolves#98
This pr converts all functions that accept `&str` to print them out to
stdout/err to accept any type that implements `Display` in its stead.
This allows these functions to not care about the implementation of the
actual print formatting and leaves that up to the implementation of
whatever needs to be printed.
### Additional tasks
- [x] Documentation for changes provided/changed
- [ ] Tests added
The following locations are potential candidates. These should not have a big impact on the rest of the code base, but they allow all the errors and other enums to have the same implementation strategy.
I would love some feedback on this.
src/infra/err.rs
tool-sync/src/infra/err.rs
Lines 3 to 13 in 65b53bd
src/infra/err.rs
tool-sync/src/infra/err.rs
Lines 15 to 31 in 65b53bd
src/infra/err.rs
tool-sync/src/infra/err.rs
Lines 33 to 37 in 65b53bd
src/sync/prefetch.rs
tool-sync/src/sync/prefetch.rs
Lines 39 to 42 in 65b53bd
src/sync/prefetch.rs
tool-sync/src/sync/prefetch.rs
Lines 44 to 64 in 65b53bd
src/sync/progress.rs
tool-sync/src/sync/progress.rs
Lines 87 to 93 in 65b53bd
The text was updated successfully, but these errors were encountered: