Skip to content

Strongly typed Axis argument (newtype called Axis) #97

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

Merged
merged 1 commit into from
Feb 29, 2016

Conversation

bluss
Copy link
Member

@bluss bluss commented Feb 28, 2016

Use a newtype Axis(usize) for all method arguments that need an axis.

@bluss
Copy link
Member Author

bluss commented Feb 28, 2016

See #96 for an alternative approach, and explanation why the generic version will not be used.

cc @vbarrielle Do you think this is ok? It's clearly more to type, but it's not possible to confuse the axis and index arguments anymore.

@bluss bluss force-pushed the strongly-typed-axis branch from edda2f0 to 9bd49a8 Compare February 28, 2016 22:36
@vbarrielle
Copy link
Contributor

Yes I think this is nice. It really removes some possible bugs and it's not that much to type. I also feel it makes the code more readable.

I agree with you that the approach in #96 is a bit too much generics.

bluss added a commit that referenced this pull request Feb 29, 2016
Strongly typed Axis argument (newtype called Axis)
@bluss bluss merged commit dbb8293 into master Feb 29, 2016
@bluss bluss deleted the strongly-typed-axis branch February 29, 2016 12:50
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.

2 participants