Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sodg::find_with_closure() must pass "self" to the closure #63

Closed
yegor256 opened this issue Jan 9, 2023 · 4 comments
Closed

Sodg::find_with_closure() must pass "self" to the closure #63

yegor256 opened this issue Jan 9, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@yegor256
Copy link
Member

yegor256 commented Jan 9, 2023

At the moment it's impossible to get access to the graph from the closure (or I'm doing something wrong):

use sodg::Sodg;
let mut g = Sodg::empty();
g.add(0).unwrap();
g.add(1).unwrap();
g.bind(0, 1, "foo").unwrap();
assert!(g.find(0, "bar").is_err());
let v = g.find_with_closure(0, "bar", |v, a, b| {
  g.find(123, "hello"); // can't compile this!
  Ok("foo".to_string())
}).unwrap();
assert_eq!(1, v);

Let's make it possible somehow to access the graph from the closure. Maybe pass it as the 4th argument to the closure?

@yegor256 yegor256 added the bug Something isn't working label Jan 9, 2023
@yegor256
Copy link
Member Author

yegor256 commented Jan 9, 2023

@UARTman can you help?

UARTman added a commit to UARTman/sodg that referenced this issue Jan 10, 2023
UARTman added a commit to UARTman/sodg that referenced this issue Jan 10, 2023
@yegor256
Copy link
Member Author

@rultor release, tag is 0.0.13

@rultor
Copy link
Contributor

rultor commented Jan 11, 2023

@rultor release, tag is 0.0.13

@yegor256 OK, I will release it now. Please check the progress here

@rultor
Copy link
Contributor

rultor commented Jan 11, 2023

@rultor release, tag is 0.0.13

@yegor256 Done! FYI, the full log is here (took me 3min)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants