Skip to content
This repository has been archived by the owner on Nov 5, 2018. It is now read-only.

Commit

Permalink
Revert "Support Rust 1.13 and bump version to 0.2"
Browse files Browse the repository at this point in the history
This reverts commit 02cf1f7.
  • Loading branch information
jeehoonkang committed Feb 10, 2018
1 parent 02cf1f7 commit 4db14fa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 24 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ rust:
- stable
- beta
- nightly
- 1.13.0

script:
- cargo build
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "crossbeam-deque"
version = "0.2.0"
version = "0.1.1"
authors = ["The Crossbeam Project Developers"]
license = "MIT/Apache-2.0"
readme = "README.md"
Expand All @@ -15,8 +15,8 @@ categories = ["algorithms", "concurrency", "data-structures"]
travis-ci = { repository = "crossbeam-rs/crossbeam-deque" }

[dependencies]
crossbeam-epoch = "0.3.0"
crossbeam-epoch = "0.2.0"
crossbeam-utils = "0.2.1"

[dev-dependencies]
rand = "0.4"
rand = "0.3"
33 changes: 13 additions & 20 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,7 @@ impl<T> Buffer<T> {
let ptr = v.as_mut_ptr();
mem::forget(v);

Buffer {
ptr: ptr,
cap: cap,
}
Buffer { ptr, cap }
}

/// Returns a pointer to the element at the specified `index`.
Expand Down Expand Up @@ -531,16 +528,14 @@ impl<T> Deque<T> {
/// assert_eq!(d.steal(), Steal::Data(1));
///
/// // Attempt to steal an element, but keep retrying if we get `Retry`.
/// loop {
/// let stolen = loop {
/// match d.steal() {
/// Steal::Empty => panic!("should steal something"),
/// Steal::Data(data) => {
/// assert_eq!(data, 2);
/// break;
/// }
/// Steal::Empty => break None,
/// Steal::Data(data) => break Some(data),
/// Steal::Retry => {}
/// }
/// }
/// };
/// assert_eq!(stolen, Some(2));
/// ```
///
/// [`Steal::Retry`]: enum.Steal.html#variant.Retry
Expand Down Expand Up @@ -669,7 +664,7 @@ impl<T> Stealer<T> {
let t = self.inner.top.load(Relaxed);
atomic::fence(SeqCst);
let b = self.inner.bottom.load(Relaxed);
std::cmp::max(b.wrapping_sub(t), 0) as usize
b.wrapping_sub(t).max(0) as usize
}

/// Steals an element from the top of the deque.
Expand All @@ -691,16 +686,14 @@ impl<T> Stealer<T> {
/// d.push(2);
///
/// // Attempt to steal an element, but keep retrying if we get `Retry`.
/// loop {
/// match d.steal() {
/// Steal::Empty => panic!("should steal something"),
/// Steal::Data(data) => {
/// assert_eq!(data, 1);
/// break;
/// }
/// let stolen = loop {
/// match s.steal() {
/// Steal::Empty => break None,
/// Steal::Data(data) => break Some(data),
/// Steal::Retry => {}
/// }
/// }
/// };
/// assert_eq!(stolen, Some(1));
/// ```
///
/// [`Steal::Retry`]: enum.Steal.html#variant.Retry
Expand Down

0 comments on commit 4db14fa

Please sign in to comment.