-
Notifications
You must be signed in to change notification settings - Fork 56
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
Clippy errors #208
Clippy errors #208
Conversation
Signed-off-by: Erik Hollensbe <git@hollensbe.org>
Signed-off-by: Erik Hollensbe <git@hollensbe.org>
I'm all for it, but I'm seeing this when I run make test.
|
Signed-off-by: Erik Hollensbe <git@hollensbe.org>
I'll look at it. I just submitted a patch tonight which fixes a few things with this branch too.
…------- Original Message -------
On Thursday, March 16th, 2023 at 4:46 PM, Travis LaDuke ***@***.***> wrote:
I'm all for it, but I'm seeing this when I run make test.
I will try again in the morning with a clearer head.
Pro clippy
Compiling zeronsd v0.5.2 (/Users/travis/repos/github.com/zerotier/zeronsd)
error[E0507]: cannot move out of `self.launcher.network_id` which is behind a shared reference
--> src/supervise.rs:350:13
|
350 | self.launcher.network_id.expect("network_id missing")
| ^^^^^^^^^^^^^^^^^^^^^^^^ ---------------------------- `self.launcher.network_id` moved due to this method call
| |
| help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents
| move occurs because `self.launcher.network_id` has type `std::option::Option<std::string::String>`, which does not implement the `Copy` trait
|
note: this function takes ownership of the receiver `self`, which moves `self.launcher.network_id`
--> /Users/travis/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:735:25
|
735 | pub const fn expect(self, msg: &str) -> T {
| ^^^^
—
Reply to this email directly, [view it on GitHub](#208 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAAET24O7SCLMERTXOQYVQ3W4OQ55ANCNFSM6AAAAAAVRFG6JA).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Tests are fixed. Since I don't have an account to run the integration tests, you'll need to fix them if they need fixing. |
awesome thanks. the tests still pass except for the little flakiness discussed elsewhere. I had to add one .as_ref() to get it to build still (see previous message). i see more lints when i run clippy. i wonder if we're running different versions of something. |
gonna merge unless you think that's a bad idea |
it's a good idea; I'll step through it again next weekend with clippy and submit a second patch. It's just a linter, and there are always new things it catches.
…------- Original Message -------
On Monday, March 20th, 2023 at 9:53 AM, Travis LaDuke ***@***.***> wrote:
gonna merge unless you think that's a bad idea
—
Reply to this email directly, [view it on GitHub](#208 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAAET26UWQFA3FIEQPAW6I3W5CDRDANCNFSM6AAAAAAVRFG6JA).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
This corrects numerous issues identified in style and general sanitation provided by
cargo clippy
. You will want to run this against the main branch (probably rebasing against #206 first, as this patch already is) to identify what changed.Here's a quick high level overview of what changed:
is_empty()
This change is much more ambitious and while confident, I am not certain that this patch will not add regressions. Please take the time to run the integration testing suite (email me if you need help setting it up) as well as manually test the supervision management code paths. I don't want you folks to release a broken change.
I do feel the code is overall better by this change, and is not superfluous. These are things I should have done a long time ago.
Thanks!