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 methods static. #1313

Merged
merged 13 commits into from
Jun 22, 2020
Merged

Conversation

teymour-aldridge
Copy link
Contributor

Description

This makes a few methods which can be static, static.

Checklist:

  • I have run ./ci/run_stable_checks.sh
  • I have reviewed my own code
  • I have added tests – if this is a bug fix, these tests will fail if the bug is present (to stop it from cropping up again). If this is a feature, my tests prove that the feature works.

hgzimmerman
hgzimmerman previously approved these changes Jun 20, 2020
Copy link
Member

@hgzimmerman hgzimmerman left a comment

Choose a reason for hiding this comment

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

Weird that codeowners pulled me in for a review here, but it looks good to me aside from a couple of tests that don't seem to be compiling at the moment:

examples/webgl/src/lib.rs:58:41
examples/webgl/src/lib.rs:134:37

Its ultimately not my decision about this change to static methods, but I am in favor of it.

@teymour-aldridge
Copy link
Contributor Author

@hgzimmerman Sorry about that; it was the result of a mess up over a rebase which meant that some commits which triggered you as a code owner were added on to this pull request – I've now removed them.

@mergify mergify bot dismissed hgzimmerman’s stale review June 20, 2020 12:01

Pull request has been modified.

Copy link
Member

@jstarry jstarry left a comment

Choose a reason for hiding this comment

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

lgtm, just one small thing

@@ -12,7 +12,7 @@ extern "C" {
}

impl CcxtService {
pub fn new() -> Self {
pub fn default() -> Self {
Copy link
Member

Choose a reason for hiding this comment

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

I think this was fine as it was, but if default is preferred, we should use the Default trait

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jstarry Not exactly sure why I did this. It should be possible to have both the new constructor and implement Default as well (fewer breaking changes that way).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Forgot that this was an example 😄. I think it's better to use Default that new here, though.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, do you mind removing the Option wrapping now that you dropped the #[derive(Default)]? I don't think it's needed after that

@jstarry jstarry merged commit e0aec40 into yewstack:master Jun 22, 2020
@jplatte
Copy link
Contributor

jplatte commented Jul 1, 2020

@teymour-aldridge The same thing could be done for ResizeService, right?

@teymour-aldridge
Copy link
Contributor Author

I imagine so.

@jplatte jplatte mentioned this pull request Jul 6, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants