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

Make Graph::new(_undirected) const #599

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cod10129
Copy link

@cod10129 cod10129 commented Nov 7, 2023

Graph's new constructor was previously not const, and I can't see why. It is useful to have a value of the type constructable at compile-time, which is why Vec::new and other functions like it in std are const. These constructors should be const, so I made this PR to do that. (MSRV note: I wasn't capable of easily finding the MSRV, but this change breaks with any version older than 1.39.)

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.

None yet

1 participant