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

Bug: Cannot move variable from getter #75

Open
navid-kalaei opened this issue Jan 30, 2021 · 1 comment
Open

Bug: Cannot move variable from getter #75

navid-kalaei opened this issue Jan 30, 2021 · 1 comment

Comments

@navid-kalaei
Copy link

In Shoutdown.rs the ownership is returning, however shouldn't the function return a borrow reference instead? I'm getting errors from the linter with the message "cannot move".

the original line :

pub(crate) fn is_shutdown(&self) -> bool {

what I think is correct [which may my thought is wrong]

pub(crate) fn is_shutdown(&self) -> &bool {
        &self.shutdown
    }
@Darksonn
Copy link
Collaborator

The bool type is Copy, so there should be no issue with returning it by-value.

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

No branches or pull requests

2 participants