mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-25 02:26:14 +03:00
Don't consume instances that are Send+Sync+Clone
They don't actually need it.
This commit is contained in:
parent
de6fd55658
commit
52c637504e
@ -40,7 +40,7 @@ impl Dispatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn run<P: AsRef<path::Path>>(
|
pub fn run<P: AsRef<path::Path>>(
|
||||||
self,
|
&self,
|
||||||
project_id: &ProjectId,
|
project_id: &ProjectId,
|
||||||
path: P,
|
path: P,
|
||||||
) -> Result<Receiver<events::Event>, RunError> {
|
) -> Result<Receiver<events::Event>, RunError> {
|
||||||
@ -54,10 +54,11 @@ impl Dispatcher {
|
|||||||
|
|
||||||
let (tx, rx) = channel(1);
|
let (tx, rx) = channel(1);
|
||||||
let project_id = *project_id;
|
let project_id = *project_id;
|
||||||
|
let cancellation_token = self.cancellation_token.clone();
|
||||||
task::spawn(async move {
|
task::spawn(async move {
|
||||||
loop {
|
loop {
|
||||||
select! {
|
select! {
|
||||||
() = self.cancellation_token.cancelled() => {
|
() = cancellation_token.cancelled() => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Some(event) = file_change_rx.recv() => {
|
Some(event) = file_change_rx.recv() => {
|
||||||
|
@ -45,7 +45,7 @@ impl Dispatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn run(
|
pub fn run(
|
||||||
self,
|
&self,
|
||||||
project_id: &ProjectId,
|
project_id: &ProjectId,
|
||||||
path: &path::Path,
|
path: &path::Path,
|
||||||
) -> Result<Receiver<events::Event>, RunError> {
|
) -> Result<Receiver<events::Event>, RunError> {
|
||||||
|
Loading…
Reference in New Issue
Block a user