Skip to content

Commit 280c673

Browse files
committed
Remove unnecessary mut on acquire fn
1 parent 3d45841 commit 280c673

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/job_token.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl JobToken {
4040
/// gives out tokens without exposing whether they're implicit tokens or tokens from jobserver.
4141
/// Furthermore, instead of giving up job tokens, it keeps them around
4242
/// for reuse if we know we're going to request another token after freeing the current one.
43-
pub(crate) struct JobTokenServer {
43+
pub(crate) struct GlobalJobTokenServer {
4444
helper: HelperThread,
4545
tx: Sender<Option<Acquired>>,
4646
rx: Receiver<Option<Acquired>>,
@@ -60,7 +60,7 @@ impl JobTokenServer {
6060
Ok(Self { helper, tx, rx })
6161
}
6262

63-
pub(crate) fn acquire(&mut self) -> JobToken {
63+
pub(crate) fn acquire(&self) -> JobToken {
6464
let token = if let Ok(token) = self.rx.try_recv() {
6565
// Opportunistically check if there's a token that can be reused.
6666
token

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,7 @@ impl Build {
13061306
}
13071307

13081308
// Limit our parallelism globally with a jobserver.
1309-
let mut tokens = crate::job_token::JobTokenServer::new()?;
1309+
let tokens = crate::job_token::JobTokenServer::new()?;
13101310

13111311
// When compiling objects in parallel we do a few dirty tricks to speed
13121312
// things up:

0 commit comments

Comments
 (0)