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

Return more Option types. #23

Open
yoshuawuyts opened this issue Apr 23, 2018 · 3 comments
Open

Return more Option types. #23

yoshuawuyts opened this issue Apr 23, 2018 · 3 comments

Comments

@yoshuawuyts
Copy link
Collaborator

Some cases to consider:

  • calling .prev() on the iterator while at the left nodes
  • calling left-child / right-child of a leaf node
  • calling left-span / right-span of a leaf node

I'm thinking we should perhaps return the Option type more often in both FlatTree and the Iterator structs.

@yoshuawuyts
Copy link
Collaborator Author

yoshuawuyts commented Apr 23, 2018

Speak of the devil. Ran into the .prev() issue.

2018-04-23-175550_3840x2160

@ralphtheninja
Copy link
Contributor

@yoshuawuyts But we're checking index in .prev()

if self.offset == 0 {
return self.index;
}

@yoshuawuyts
Copy link
Collaborator Author

yoshuawuyts commented Apr 23, 2018

apparently it can slip through and still crash. Error originates on Iterator, line 69 😞

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

No branches or pull requests

2 participants