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

the closure in Sodg::find_with_closure() should be able to return absolute coordinate of a vertex #60

Closed
yegor256 opened this issue Jan 9, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@yegor256
Copy link
Member

yegor256 commented Jan 9, 2023

This should be possible:

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| {
  assert_eq!(a, "bar");
  assert_eq!(b, "");
  Ok("ν1".to_string())
}).unwrap();
assert_eq!(1, v);

Here, the closure returns "ν1", which is the absolute coordinate of the vertex no.1.

@yegor256 yegor256 added the enhancement New feature or request label Jan 9, 2023
@yegor256
Copy link
Member Author

yegor256 commented Jan 9, 2023

@UARTman can you please help?

@yegor256 yegor256 changed the title the closure in find_with_closure may return absolute coordinate of a vertex the closure in Sodg::find_with_closure may return absolute coordinate of a vertex Jan 9, 2023
@yegor256 yegor256 changed the title the closure in Sodg::find_with_closure may return absolute coordinate of a vertex the closure in Sodg::find_with_closure() should be able to return absolute coordinate of a vertex Jan 9, 2023
UARTman added a commit to UARTman/sodg that referenced this issue Jan 10, 2023
It now uses `self.find` on the closure result.
UARTman added a commit to UARTman/sodg that referenced this issue Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants