diff options
author | Teddy Wing | 2020-07-25 22:51:22 +0200 |
---|---|---|
committer | Teddy Wing | 2020-07-25 22:51:22 +0200 |
commit | b4a7561ccc1ed7dab6cd2c786902dec8c4ad9be6 (patch) | |
tree | 34a4d4eee09ed4c74b05a093280bb4c5b81b347f /src/url.rs | |
parent | a0ca545e790219015ef0e02069f6ba4258510b54 (diff) | |
download | git-suggestion-b4a7561ccc1ed7dab6cd2c786902dec8c4ad9be6.tar.bz2 |
Suggestion.apply_to(): Read from given reader, not original file
We can't read from the original file, because we want to be able to use
that as the writer in `apply()`.
Previously, this would result in the original file simply being
truncated, as we weren't reading from the correct file.
To fix this, we need to give `apply_to()` both a reader and a writer.
Now, in `apply()`, we can pass it the temporary file to read, and the
original to write to.
Used a `Path` as an input to `apply_to()` instead of a `Read`er because
I got an error that didn't really make sense to me when I did so:
error[E0275]: overflow evaluating the requirement `&tokio_reactor::poll_evented::PollEvented<_>: std::io::Read`
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`git_suggested_patch`)
= note: required because of the requirements on the impl of `std::io::Read` for `&tokio_reactor::poll_evented::PollEvented<tokio_reactor::poll_evented::PollEvented<_>>`
= note: required because of the requirements on the impl of `std::io::Read` for `&tokio_reactor::poll_evented::PollEvented<tokio_reactor::poll_evented::PollEvented<tokio_reactor::poll_evented::PollEvented<_>>>`
A search for the error message turned up a few active issues:
- https://github.com/rust-lang/rust/issues/57854
- https://github.com/rust-lang/rust/issues/62755
- https://github.com/rust-lang/rust/issues/39959
The above issues indicate that this could come from having a variable
with an inferred type. However, for the moment the issue isn't resolved,
and the error message doesn't indicate where the problem is actually
coming from. As I was unable to track down the source of the problem, I
decided not to bother using a `Read` argument.
Diffstat (limited to 'src/url.rs')
0 files changed, 0 insertions, 0 deletions