I implemented the traits that nom requires for Tokens what wraps a slice reference ,
Usually , the functions of nom return like (rest_of_the_input , result)
In the code blow , I expected the return values of wrapa to be empty and b got something , like the return values of wrap2, but things didn't happened like that .
The output
I expected `a` to be empty and `b` has element Variant .
[src\main.rs:27] a = Tokens {
tok: [
Variant,
],
}
[src\main.rs:27] b = Tokens {
tok: [],
}
The type &str works well
[src\main.rs:30] a = ""
[src\main.rs:30] b = "1"
I implemented the traits that nom requires for Tokens what wraps a slice reference , Usually , the functions of nom return like (rest_of_the_input , result) In the code blow , I expected the return values of
wrap
a
to be empty andb
got something , like the return values ofwrap2
, but things didn't happened like that .The output