-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/reading graph #16
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
base: main
Are you sure you want to change the base?
Conversation
|
|
||
| impl<T> Into<Graph> for DFA<T> { | ||
| fn into(self) -> Graph { | ||
| impl<T> IntoGraph for DFA<T> { | ||
| fn into_graph(&self) -> Graph { | ||
| let mut graph = Graph::new(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In rust ci sono dei trait From e Into che sono builtin, non sarebbe meglio utilizzare quelli?
https://doc.rust-lang.org/std/convert/trait.From.html
Poi se implementi from hai già into. Però alla fine è solo questione di stile quindi come vuoi 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Into non puoi passare l'oggetto come reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puoi, ti basta implementare Into<&Graph>.
| let nfa = NFA::from(®ex); | ||
| println!("{:?}", nfa); | ||
| let out = serde_json::to_string(&nfa); | ||
| panic!("{:?}\n", out.unwrap()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
questo test utile per debuggare, però dovresti fixarlo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
|
|
||
| use super::NFA; | ||
|
|
||
| //TODO rifare tutto con strade |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
è ancora utile questo commento?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nop
| move |input| tuple((multispace0, tag(label), multispace0, tag(":"), multispace0))(input) | ||
| } | ||
|
|
||
| fn read_start_stete(input: &str) -> IResult<&str, usize> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo stete
No description provided.