Chore: Fix warnings for openxr (#38045)

These warnings have been there for quite a while and annoying.

```
   Compiling webxr v0.0.1 (D:\servo\components\webxr)
warning: variable does not need to be mutable
   --> components\webxr\openxr\mod.rs:557:17
    |
557 |             let mut context = contexts
    |                 ----^^^^^^^
    |                 |
    |                 help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default

warning: field `profile_type` is never read
  --> components\webxr\openxr\interaction_profiles.rs:50:9
   |
49 | pub struct InteractionProfile<'a> {
   |            ------------------ field in this struct
50 |     pub profile_type: InteractionProfileType,
   |         ^^^^^^^^^^^^
   |
   = note: `InteractionProfile` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis
   = note: `#[warn(dead_code)]` on by default
```

Testing: No behaviour change.

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
Euclid Ye 2025-07-14 14:01:37 +08:00 committed by GitHub
parent c2df8a1bf5
commit 54a02d5a34
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -47,6 +47,7 @@ pub enum InteractionProfileType {
#[derive(Clone, Copy, Debug)]
pub struct InteractionProfile<'a> {
#[allow(dead_code)]
pub profile_type: InteractionProfileType,
/// The interaction profile path
pub path: &'static str,

View file

@ -554,7 +554,7 @@ impl LayerManagerAPI<SurfmanGL> for OpenXrLayerManager {
let gl = contexts.bindings(device, context_id).unwrap();
unsafe { gl.delete_texture(depth_stencil_texture) };
}
let mut context = contexts
let context = contexts
.context(device, context_id)
.expect("missing GL context");
for surface_texture in mem::replace(&mut layer.surface_textures, vec![]) {