Skip to content

Commit

Permalink
Clearly document SegQueue is FIFO (#1144)
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun authored Nov 8, 2024
1 parent 46fe32b commit aba6f56
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crossbeam-queue/src/seg_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ impl<T> SegQueue<T> {
}
}

/// Pushes an element into the queue.
/// Pushes back an element to the tail.
///
/// # Examples
///
Expand Down Expand Up @@ -268,7 +268,7 @@ impl<T> SegQueue<T> {
}
}

/// Pops an element from the queue.
/// Pops the head element from the queue.
///
/// If the queue is empty, `None` is returned.
///
Expand All @@ -280,7 +280,9 @@ impl<T> SegQueue<T> {
/// let q = SegQueue::new();
///
/// q.push(10);
/// q.push(20);
/// assert_eq!(q.pop(), Some(10));
/// assert_eq!(q.pop(), Some(20));
/// assert!(q.pop().is_none());
/// ```
pub fn pop(&self) -> Option<T> {
Expand Down

0 comments on commit aba6f56

Please sign in to comment.