Skip to content

Commit e6d5bc4

Browse files
committed
Fix warnings in new rust version
1 parent aad6dd4 commit e6d5bc4

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

libretro/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ fn core() -> &'static Core {
9898
// to this function. CORE is never mutate after being initialized, so subsequent calls to this
9999
// function will not invalidate previous returned references.
100100
unsafe {
101+
#[allow(static_mut_refs)]
101102
let core = CORE.get_or_insert_with(Core::default);
102103

103104
// assert this is single-threaded

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ where
127127
{
128128
use serde::de;
129129
struct ScreenSizeVisitor;
130-
impl<'de> de::Visitor<'de> for ScreenSizeVisitor {
130+
impl de::Visitor<'_> for ScreenSizeVisitor {
131131
type Value = Option<(u32, u32)>;
132132

133133
fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// To minimize changes between platforms, we still use Arc-Mutex on Wasm.
22
#![allow(clippy::arc_with_non_send_sync)]
3+
// My deserializer macro triggers this warning, need to fix it in the dependency later.
4+
#![allow(non_local_definitions)]
35

46
#[cfg(target_arch = "wasm32")]
57
pub static RESIZE: parking_lot::Mutex<Option<(u32, u32)>> = parking_lot::const_mutex(None);

src/style.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ mod loaded_files {
7575

7676
use super::config;
7777

78-
impl<'a> StyleLoaderCallback for super::Loader<'a> {
78+
impl StyleLoaderCallback for super::Loader<'_> {
7979
fn load_texture(&mut self, mut name: String) -> (u32, u32, u32) {
8080
if name == "icons.png" {
8181
name = format!("icons{}x.png", self.scale_factor.to_float()).to_string();
@@ -185,7 +185,7 @@ mod static_files {
185185
include_bytes!("../assets/icons4x.png"),
186186
],
187187
};
188-
impl<'a> StyleLoaderCallback for super::Loader<'a> {
188+
impl StyleLoaderCallback for super::Loader<'_> {
189189
fn load_texture(&mut self, name: String) -> (u32, u32, u32) {
190190
if let Some(texture) = self.textures.get(&name) {
191191
return *texture;

src/ui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mod rom_loading_ui;
2424
pub use rom_loading_ui::{create_rom_loading_ui, RomEntries};
2525

2626
struct Render<'a>(&'a mut dyn SpriteRender);
27-
impl<'a> GuiRenderer for Render<'a> {
27+
impl GuiRenderer for Render<'_> {
2828
fn update_font_texture(&mut self, font_texture: u32, rect: [u32; 4], data_tex: &[u8]) {
2929
let mut data = Vec::with_capacity(data_tex.len() * 4);
3030
for byte in data_tex.iter() {

0 commit comments

Comments
 (0)