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

fix: scope ownership in get config HP mode #427

Merged
merged 1 commit into from
Feb 24, 2025
Merged

Conversation

Datron
Copy link
Collaborator

@Datron Datron commented Feb 24, 2025

Problem

Scope is being moved out

error[E0382]: use of moved value: `scope`
#33 164.3    --> superposition/crates/context_aware_config/src/api/config/handlers.rs:62:5
#33 164.3     |
#33 164.3 55  |     let scope = Scope::new("")
#33 164.3     |         ----- move occurs because `scope` has type `actix_web::Scope`, which does not implement the `Copy` trait
#33 164.3 ...
#33 164.3 61  |     scope.service(get_config_fast);
#33 164.3     |           ------------------------ `scope` moved due to this method call
#33 164.3 62  |     scope
#33 164.3     |     ^^^^^ value used here after move
#33 164.3     |
#33 164.3 note: `actix_web::Scope::<T>::service` takes ownership of the receiver `self`, which moves `scope`
#33 164.3    --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/actix-web-4.5.1/src/scope.rs:233:27
#33 164.3     |
#33 164.3 233 |     pub fn service<F>(mut self, factory: F) -> Self
#33 164.3     |                           ^^^^
#33 164.3 

Solution

use let

@Datron Datron requested a review from a team as a code owner February 24, 2025 07:57
@Datron Datron merged commit e9470c2 into main Feb 24, 2025
4 checks passed
@Datron Datron deleted the fix-hp-mode-config branch February 24, 2025 08:36
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.

4 participants