diff --git a/.monorepo/lints.toml b/.monorepo/lints.toml
index 4a4ca4cb9e..86dbdb7350 100644
--- a/.monorepo/lints.toml
+++ b/.monorepo/lints.toml
@@ -106,7 +106,7 @@ warn = [
"clippy::suspicious_operation_groupings",
"clippy::trailing_empty_array",
"clippy::trivial_regex",
- "clippy::use_self",
+ # "clippy::use_self", // disabling for Rust 1.61, see https://github.com/rust-lang/rust-clippy/issues/6902
"clippy::useless_let_if_seq",
"clippy::useless_transmute",
# Clippy restriction lints, usually not considered bad, but useful in specific cases
diff --git a/Cargo.lock b/Cargo.lock
index 947a12c92b..809547db00 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3898,7 +3898,6 @@ dependencies = [
"lgn-tasks",
"lgn-tracing",
"ntest",
- "retain_mut",
"tokio",
]
@@ -7313,12 +7312,6 @@ dependencies = [
"winreg",
]
-[[package]]
-name = "retain_mut"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0"
-
[[package]]
name = "rfc6979"
version = "0.1.0"
diff --git a/README.md b/README.md
index fcd1eddc43..18b82f00fc 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@
-
+
diff --git a/crates/lgn-api-codegen/src/api.rs b/crates/lgn-api-codegen/src/api.rs
index 790338a0b7..50de7ae7f1 100644
--- a/crates/lgn-api-codegen/src/api.rs
+++ b/crates/lgn-api-codegen/src/api.rs
@@ -195,14 +195,14 @@ pub enum Method {
impl std::fmt::Display for Method {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(match self {
- Method::Get => "GET",
- Method::Post => "POST",
- Method::Delete => "DELETE",
- Method::Put => "PUT",
- Method::Patch => "PATCH",
- Method::Head => "HEAD",
- Method::Options => "OPTIONS",
- Method::Trace => "TRACE",
+ Self::Get => "GET",
+ Self::Post => "POST",
+ Self::Delete => "DELETE",
+ Self::Put => "PUT",
+ Self::Patch => "PATCH",
+ Self::Head => "HEAD",
+ Self::Options => "OPTIONS",
+ Self::Trace => "TRACE",
})
}
}
diff --git a/crates/lgn-async/Cargo.toml b/crates/lgn-async/Cargo.toml
index 67ccbe570f..460c2bc2fe 100644
--- a/crates/lgn-async/Cargo.toml
+++ b/crates/lgn-async/Cargo.toml
@@ -14,7 +14,6 @@ lgn-app = { path = "../lgn-app", version = "0.1.0" }
lgn-tracing = { path = "../lgn-tracing", version = "0.1.0" }
lgn-tasks = { path = "../lgn-tasks", version = "0.1.0" }
tokio = { version = "1.13", features = ["full", "tracing"] }
-retain_mut = "0.1"
futures-lite = "1.12"
[dev-dependencies]
diff --git a/crates/lgn-async/src/runtime.rs b/crates/lgn-async/src/runtime.rs
index dc06d9a15a..6530fba985 100644
--- a/crates/lgn-async/src/runtime.rs
+++ b/crates/lgn-async/src/runtime.rs
@@ -151,9 +151,7 @@ impl TokioAsyncRuntime {
pub fn poll(&mut self) -> u32 {
let mut num_completed = 0;
- // TODO: #1886 Fix after we move to 1.61
- #[allow(deprecated)]
- retain_mut::RetainMut::retain_mut(&mut self.result_handlers, |handler| {
+ self.result_handlers.retain_mut(|handler| {
let is_complete = handler.try_complete();
if is_complete {
diff --git a/crates/lgn-content-store/src/content_providers/hash_ref.rs b/crates/lgn-content-store/src/content_providers/hash_ref.rs
index d34dea6881..daa62d757e 100644
--- a/crates/lgn-content-store/src/content_providers/hash_ref.rs
+++ b/crates/lgn-content-store/src/content_providers/hash_ref.rs
@@ -65,7 +65,7 @@ pub enum HashAlgorithm {
impl Display for HashAlgorithm {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
- HashAlgorithm::Blake3 => write!(f, "blake3"),
+ Self::Blake3 => write!(f, "blake3"),
}
}
}
diff --git a/crates/lgn-data-codegen/src/lib.rs b/crates/lgn-data-codegen/src/lib.rs
index c8b27ce1bd..9d8df49563 100644
--- a/crates/lgn-data-codegen/src/lib.rs
+++ b/crates/lgn-data-codegen/src/lib.rs
@@ -40,8 +40,8 @@ impl GenerationType {
/// Returns the name of the generation type
pub fn name(self) -> &'static str {
match self {
- GenerationType::OfflineFormat => "offline",
- GenerationType::RuntimeFormat => "runtime",
+ Self::OfflineFormat => "offline",
+ Self::RuntimeFormat => "runtime",
}
}
}
diff --git a/crates/lgn-data-compiler/src/lib.rs b/crates/lgn-data-compiler/src/lib.rs
index 68de5a6ee8..6f1673cce1 100644
--- a/crates/lgn-data-compiler/src/lib.rs
+++ b/crates/lgn-data-compiler/src/lib.rs
@@ -107,9 +107,9 @@ pub enum Target {
impl fmt::Display for Target {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
- Target::Game => write!(f, "game"),
- Target::Server => write!(f, "server"),
- Target::Backend => write!(f, "backend"),
+ Self::Game => write!(f, "game"),
+ Self::Server => write!(f, "server"),
+ Self::Backend => write!(f, "backend"),
}
}
}
@@ -141,9 +141,9 @@ pub enum Platform {
impl fmt::Display for Platform {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
- Platform::Windows => write!(f, "windows"),
- Platform::Unix => write!(f, "unix"),
- Platform::ConsoleX => write!(f, "consolex"),
+ Self::Windows => write!(f, "windows"),
+ Self::Unix => write!(f, "unix"),
+ Self::ConsoleX => write!(f, "consolex"),
}
}
}
diff --git a/crates/lgn-data-model/src/array_descriptor.rs b/crates/lgn-data-model/src/array_descriptor.rs
index 12c61b638a..68dfd94719 100644
--- a/crates/lgn-data-model/src/array_descriptor.rs
+++ b/crates/lgn-data-model/src/array_descriptor.rs
@@ -66,23 +66,23 @@ macro_rules! implement_array_descriptor {
static ref ARRAY_DESCRIPTOR: $crate::ArrayDescriptor = $crate::ArrayDescriptor {
base_descriptor : $crate::create_base_descriptor!(Vec<$type_id>, concat!("Vec<",stringify!($type_id),">").into(), Result::, $crate::ReflectionError>::Ok(Vec::<$type_id>::new())),
inner_type: <$type_id as $crate::TypeReflection>::get_type_def(),
- len: |array: *const ()| unsafe { (*(array as *const Vec<$type_id>)).len() },
+ len: |array: *const ()| unsafe { (*array.cast::>()).len() },
get: |array: *const (), index: usize| unsafe {
- (*(array as *const Vec<$type_id>))
+ (*array.cast::>())
.get(index).ok_or_else(|| $crate::ReflectionError::InvalidArrayIndex(index, concat!("Vec<",stringify!($type_id),">")))
.and_then(|value| Ok((value as *const $type_id).cast::<()>()))
},
get_mut:|array: *mut (), index: usize| unsafe {
- (*(array as *mut Vec<$type_id>))
+ (*array.cast::>())
.get_mut(index).ok_or_else(|| $crate::ReflectionError::InvalidArrayIndex(index, concat!("Vec<",stringify!($type_id),">")))
.and_then(|value| Ok((value as *mut $type_id).cast::<()>()))
},
clear:|array: *mut ()| unsafe {
- (*(array as *mut Vec<$type_id>)).clear();
+ (*array.cast::>()).clear();
},
insert_element : |array: *mut(), index : Option, deserializer: &mut dyn::erased_serde::Deserializer<'_>| unsafe {
- let array = &mut (*(array as *mut Vec<$type_id>));
+ let array = &mut (*array.cast::>());
let new_element : $type_id = ::erased_serde::deserialize(deserializer)
.map_err(|err|$crate::utils::ReflectionError::ErrorErasedSerde(err))?;
@@ -95,7 +95,7 @@ macro_rules! implement_array_descriptor {
},
delete_element : |array: *mut(), index : usize, old_value_ser: Option<&mut dyn::erased_serde::Serializer> | unsafe {
- let array = &mut (*(array as *mut Vec<$type_id>));
+ let array = &mut (*array.cast::>());
if index >= array.len() {
return Err($crate::ReflectionError::InvalidArrayIndex(index, concat!("Vec<",stringify!($type_id),">")));
}
@@ -107,7 +107,7 @@ macro_rules! implement_array_descriptor {
Ok(())
},
reorder_element : |array: *mut(), old_index : usize, new_index : usize | unsafe {
- let array = &mut (*(array as *mut Vec<$type_id>));
+ let array = &mut (*array.cast::>());
if old_index >= array.len() {
return Err($crate::ReflectionError::InvalidArrayIndex(old_index, concat!("Vec<",stringify!($type_id),">")));
}
@@ -123,7 +123,7 @@ macro_rules! implement_array_descriptor {
let value_to_delete = ::erased_serde::deserialize::<$type_id>(value_de)
.map_err(|err| $crate::ReflectionError::ErrorErasedSerde(err))?;
- let array = &mut (*(array as *mut Vec<$type_id>));
+ let array = &mut (*array.cast::>());
if let Some((old_value,index)) = $crate::array_remove_value(array,&value_to_delete) {
if let Some(serializer) = old_value_ser {
::erased_serde::serialize(&old_value, serializer)
diff --git a/crates/lgn-data-model/src/option_descriptor.rs b/crates/lgn-data-model/src/option_descriptor.rs
index b55f2b0a24..32327a33ac 100644
--- a/crates/lgn-data-model/src/option_descriptor.rs
+++ b/crates/lgn-data-model/src/option_descriptor.rs
@@ -22,12 +22,12 @@ macro_rules! implement_option_descriptor {
Result::, $crate::ReflectionError>::Ok(Option::<$type_id>::None)),
inner_type: <$type_id as $crate::TypeReflection>::get_type_def(),
get_inner: |option: *const ()| unsafe {
- (*(option as *const Option<$type_id>))
+ (*option.cast::