mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 22:30:03 -04:00
Enable and fix some more clippy lints (#7426)
One can never have too many lints
This commit is contained in:
@@ -893,16 +893,15 @@ pub trait Storage {
|
||||
#[cfg(feature = "ron")]
|
||||
pub fn get_value<T: serde::de::DeserializeOwned>(storage: &dyn Storage, key: &str) -> Option<T> {
|
||||
profiling::function_scope!(key);
|
||||
storage
|
||||
.get_string(key)
|
||||
.and_then(|value| match ron::from_str(&value) {
|
||||
Ok(value) => Some(value),
|
||||
Err(err) => {
|
||||
// This happens on when we break the format, e.g. when updating egui.
|
||||
log::debug!("Failed to decode RON: {err}");
|
||||
None
|
||||
}
|
||||
})
|
||||
let value = storage.get_string(key)?;
|
||||
match ron::from_str(&value) {
|
||||
Ok(value) => Some(value),
|
||||
Err(err) => {
|
||||
// This happens on when we break the format, e.g. when updating egui.
|
||||
log::debug!("Failed to decode RON: {err}");
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Serialize the given value as [RON](https://github.com/ron-rs/ron) and store with the given key.
|
||||
|
||||
Reference in New Issue
Block a user