Skip to content

Conversation

@giospada
Copy link
Owner

No description provided.

Comment on lines -279 to 282

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();
Copy link
Collaborator

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 🤷‍♂️

Copy link
Owner Author

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

Copy link
Collaborator

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(&regex);
println!("{:?}", nfa);
let out = serde_json::to_string(&nfa);
panic!("{:?}\n", out.unwrap());
Copy link
Collaborator

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.

Copy link
Owner Author

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

è ancora utile questo commento?

Copy link
Owner Author

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> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo stete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants