Skip to content

Commit b2d6bbc

Browse files
author
Stjepan Glavina
authored
Merge pull request #1 from garious/trivial-cleanup
Remove redundant conditional
2 parents ae0c5c5 + dc97271 commit b2d6bbc

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/bounded.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub struct Bounded<T> {
4949
/// If this bit is set in the tail, that means the queue is closed.
5050
mark_bit: usize,
5151

52-
/// Indicates that dropping an `Bounded<T>` may drop values of type `T`.
52+
/// Indicates that dropping a `Bounded<T>` may drop values of type `T`.
5353
_marker: PhantomData<T>,
5454
}
5555

@@ -288,12 +288,7 @@ impl<T> Bounded<T> {
288288
/// Returns `true` if this call closed the queue.
289289
pub fn close(&self) -> bool {
290290
let tail = self.tail.fetch_or(self.mark_bit, Ordering::SeqCst);
291-
292-
if tail & self.mark_bit == 0 {
293-
true
294-
} else {
295-
false
296-
}
291+
tail & self.mark_bit == 0
297292
}
298293

299294
/// Returns `true` if the queue is closed.

src/unbounded.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,7 @@ impl<T> Unbounded<T> {
365365
/// Returns `true` if this call closed the queue.
366366
pub fn close(&self) -> bool {
367367
let tail = self.tail.index.fetch_or(MARK_BIT, Ordering::SeqCst);
368-
369-
if tail & MARK_BIT == 0 {
370-
true
371-
} else {
372-
false
373-
}
368+
tail & MARK_BIT == 0
374369
}
375370

376371
/// Returns `true` if the queue is closed.

0 commit comments

Comments
 (0)