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

Remove repeated weight_callable code #462

Merged
merged 2 commits into from
Oct 15, 2021

Conversation

IvanIsCoding
Copy link
Collaborator

Profiting from #459 that made weight_callable generic to remove some code duplication

@coveralls
Copy link

coveralls commented Oct 13, 2021

Pull Request Test Coverage Report for Build 1346662804

  • 12 of 12 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.007%) to 98.39%

Totals Coverage Status
Change from base Build 1346407133: -0.007%
Covered Lines: 10203
Relevant Lines: 10370

💛 - Coveralls

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

LGTM, seems straightforward enough. One inline question, but just my curiosity and not really anything actionable.

py,
&weight_fn,
edge.weight(),
None as Option<String>,
Copy link
Member

Choose a reason for hiding this comment

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

I guess the cast here is because the compiler can't infer the type with the generic?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Exactly, the compiler cannot infer the type of Option::None by default

@mtreinish mtreinish merged commit 9dff1bb into Qiskit:main Oct 15, 2021
@IvanIsCoding IvanIsCoding deleted the weight-code-duplication branch October 24, 2021 20:40
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