Skip to content

Commit

Permalink
docs: remove pattern deref from inspect, filter examples (hydro-proje…
Browse files Browse the repository at this point in the history
…ct#799)

`*` derefs are easier for Rust beginners to comprehend.
  • Loading branch information
MingweiSamuel authored Jun 30, 2023
1 parent ab7bc16 commit 6585987
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ for an interactive demo.
```rust
source_iter(0..10)
-> map(|n| n * n)
-> filter(|&n| n > 10)
-> filter(|n| *n > 10)
-> foo;

foo = map(|n| (n..=n+1))
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ source_iter(0..10) -> for_each(|n| println!("Hello {}", n));`,
// https://hydro.run/docs/hydroflow/quickstart/example_2_simple
source_iter(0..10)
-> map(|n| n * n)
-> filter(|&n| n > 10)
-> filter(|n| *n > 10)
-> map(|n| (n..=n+1))
-> flatten()
-> for_each(|n| println!("Howdy {}", n));`,
Expand Down
2 changes: 1 addition & 1 deletion hydroflow/examples/example_2_simple_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub fn main() {
let mut flow = hydroflow_syntax! {
source_iter(0..10)
-> map(|n| n * n)
-> filter(|&n| n > 10)
-> filter(|n| *n > 10)
-> map(|n| (n..=n+1))
-> flatten()
-> for_each(|n| println!("Howdy {}", n));
Expand Down
2 changes: 1 addition & 1 deletion hydroflow_lang/src/graph/ops/inspect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use super::{
///
/// ```hydroflow
/// source_iter([1, 2, 3, 4])
/// -> inspect(|&x| println!("{}", x))
/// -> inspect(|x| println!("{}", x))
/// -> assert([1, 2, 3, 4]);
/// ```
pub const INSPECT: OperatorConstraints = OperatorConstraints {
Expand Down

0 comments on commit 6585987

Please sign in to comment.