diff options
author | kxt <ktamas@fastmail.fm> | 2021-05-27 16:28:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-27 16:28:28 +0200 |
commit | 0c0355dbc6e0159a72b0f55c7aabb83d76c2312a (patch) | |
tree | eb09715c31950f918efe54bd189af65b5b2fdab0 /Cargo.lock | |
parent | 9bdb40b4c644c6a3a061dd0cc4683fc92d504201 (diff) |
refactors for #525 (#534)
* refactor(fakes): clean up add_terminal_input
* refactor(fakes): append whole buf to output_buffer in FakeStdoutWriter::write
* refactor(fakes): append whole buf to output_buffer in FakeInputOutput::write_to_tty_stdin
* fix(fakes): allow partial reads in read_from_tty_stdout
This patch fixes two bugs in read_from_tty_stdout:
* if there was a partial read (ie. `bytes.read_position` is not 0 but
less than `bytes.content.len()`), subsequent calls to would fill `buf`
starting at index `bytes.read_position` instead of 0, leaving range
0..`bytes.read_position` untouched.
* if `buf` was smaller than `bytes.content.len()`, a panic would occur.
* refactor(channels): use crossbeam instead of mpsc
This patch replaces mpsc with crossbeam channels because crossbeam
supports selecting on multiple channels which will be necessary in a
subsequent patch.
* refactor(threadbus): allow multiple receivers in Bus
This patch changes Bus to use multiple receivers. Method `recv` returns
data from all of them. This will be used in a subsequent patch for
receiving from bounded and unbounded queues at the same time.
* refactor(channels): remove SenderType enum
This enum has only one variant, so the entire enum can be replaced with
the innards of said variant.
* refactor(channels): remove Send+Sync trait implementations
The implementation of these traits is not necessary, as
SenderWithContext is automatically Send and Sync for every T and
ErrorContext that's Send and Sync.
Diffstat (limited to 'Cargo.lock')
-rw-r--r-- | Cargo.lock | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Cargo.lock b/Cargo.lock index 5283550e6..dc862d534 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -418,6 +418,20 @@ dependencies = [ ] [[package]] +name = "crossbeam" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd01a6eb3daaafa260f6fc94c3a6c36390abc2080e38e3e34ced87393fb77d80" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] name = "crossbeam-channel" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -452,6 +466,16 @@ dependencies = [ ] [[package]] +name = "crossbeam-queue" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f6cb3c7f5b8e51bc3ebb73a2327ad4abdbd119dc13223f14f961d2f38486756" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] name = "crossbeam-utils" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2355,6 +2379,7 @@ dependencies = [ "backtrace", "bincode", "colors-transform", + "crossbeam", "directories-next", "interprocess", "lazy_static", |