We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
rust-analyzer version: V0.3.2188
rustc version: 1.81.9
editor or extension: VSCode on macOS
code snippet to reproduce:
pub async fn new_course( new_course: web::Json<Course>, app_state: web::Data<AppState>, ) -> HttpResponse { let course_count = app_state .courses .lock() .unwrap() .clone() .into_iter() .filter(|course| course.teacher_id == new_course.teacher_id) .collect::<Vec<Course>>() .len(); let new_course = Course { teacher_id: new_course.teacher_id, id: Some(course_count + 1), name: new_course.name.clone(), time: Some(Utc::now().naive_utc()), }; app_state.courses.lock().unwrap().push(new_course); HttpResponse::Ok().json("Course added") }
The IDE always issues an unused variable warning for the variable 'course_count', even if you prefix the variable with '_'
The text was updated successfully, but these errors were encountered:
Which crates are you using there?
Sorry, something went wrong.
FWIW, I don't get any warning. And you're unnecessarily cloning courses there.
courses
No branches or pull requests
rust-analyzer version: V0.3.2188
rustc version: 1.81.9
editor or extension: VSCode on macOS
code snippet to reproduce:
The IDE always issues an unused variable warning for the variable 'course_count', even if you prefix the variable with '_'
The text was updated successfully, but these errors were encountered: