mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
parent
effc1eae8b
commit
c2c10b9014
10 changed files with 51 additions and 71 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
use std::thread;
|
||||
|
||||
use crossbeam_channel::{bounded, unbounded, Receiver, Sender};
|
||||
use crossbeam_channel::{bounded, unbounded, Receiver, Sender, RecvError, SendError};
|
||||
use drop_bomb::DropBomb;
|
||||
|
||||
pub struct Worker<I, O> {
|
||||
|
@ -34,10 +34,10 @@ impl<I, O> Worker<I, O> {
|
|||
self.out
|
||||
}
|
||||
|
||||
pub fn send(&self, item: I) {
|
||||
pub fn send(&self, item: I) -> Result<(), SendError<I>> {
|
||||
self.inp.send(item)
|
||||
}
|
||||
pub fn recv(&self) -> Option<O> {
|
||||
pub fn recv(&self) -> Result<O, RecvError> {
|
||||
self.out.recv()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue