Bump to v2.0.0
This commit is contained in:
parent
7d1c36b2fc
commit
32f352e6a2
|
@ -1,3 +1,7 @@
|
|||
# Version 2.0.0
|
||||
|
||||
- `Parallel::run()` now collects results.
|
||||
|
||||
# Version 1.0.1
|
||||
|
||||
- Remove unused `mut`.
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
[package]
|
||||
name = "easy-parallel"
|
||||
version = "1.0.1"
|
||||
version = "2.0.0"
|
||||
authors = ["Stjepan Glavina <stjepang@gmail.com>"]
|
||||
edition = "2018"
|
||||
description = "Easy parallel closures"
|
||||
description = "Run closures in parallel"
|
||||
license = "Apache-2.0 OR MIT"
|
||||
repository = "https://github.com/stjepang/easy-parallel"
|
||||
homepage = "https://github.com/stjepang/easy-parallel"
|
||||
|
|
11
README.md
11
README.md
|
@ -9,7 +9,7 @@ https://crates.io/crates/easy-parallel)
|
|||
[![Documentation](https://docs.rs/easy-parallel/badge.svg)](
|
||||
https://docs.rs/easy-parallel)
|
||||
|
||||
Easy parallel closures.
|
||||
Run closures in parallel.
|
||||
|
||||
This is a simple primitive for spawning threads in bulk and waiting for them to complete.
|
||||
Threads are allowed to borrow local variables from the main thread.
|
||||
|
@ -32,16 +32,19 @@ Parallel::new()
|
|||
assert_eq!(*m.get_mut().unwrap(), 2);
|
||||
```
|
||||
|
||||
Print each number in a vector on a different thread:
|
||||
Square each number of a vector on a different thread:
|
||||
|
||||
```rust
|
||||
use easy_parallel::Parallel;
|
||||
|
||||
let v = vec![10, 20, 30];
|
||||
|
||||
Parallel::new()
|
||||
.each(0..v.len(), |i| println!("{}", v[i]))
|
||||
let mut squares = Parallel::new()
|
||||
.each(0..v.len(), |i| v[i] * v[i])
|
||||
.run();
|
||||
|
||||
squares.sort();
|
||||
assert_eq!(squares, [100, 400, 900]);
|
||||
```
|
||||
|
||||
## License
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//! Easy parallel closures.
|
||||
//! Run closures in parallel.
|
||||
//!
|
||||
//! This is a simple primitive for spawning threads in bulk and waiting for them to complete.
|
||||
//! Threads are allowed to borrow local variables from the main thread.
|
||||
|
|
Loading…
Reference in New Issue