Skip to content

Commit

Permalink
Update/Rust 1.83 changes (#283)
Browse files Browse the repository at this point in the history
Support new warnings and lints in Rust 1.83. This includes a cargo update as some dependencies containing proc macros needed updates for compatibility with new warnings.
  • Loading branch information
Electron100 authored Nov 29, 2024
1 parent 2db1e81 commit 31f5fbd
Show file tree
Hide file tree
Showing 8 changed files with 232 additions and 313 deletions.
526 changes: 222 additions & 304 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions butane_core/src/codegen/dbobj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ where
}

fn impl_many_save(ast_struct: &ItemStruct, config: &Config, is_async: bool) -> TokenStream2 {
return fields(ast_struct)
fields(ast_struct)
.filter(|f| is_many_to_many(f))
.map(|f| {
let ident = f.ident.clone().expect("Fields must be named for butane");
Expand All @@ -451,7 +451,7 @@ fn impl_many_save(ast_struct: &ItemStruct, config: &Config, is_async: bool) -> T
#save_with_conn
)
})
.collect();
.collect()
}

#[cfg(feature = "async")]
Expand Down
2 changes: 1 addition & 1 deletion butane_core/src/db/connmethods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ where
}
}

impl<'a> BackendRows for Box<dyn BackendRows + 'a> {
impl BackendRows for Box<dyn BackendRows + '_> {
fn next(&mut self) -> Result<Option<&(dyn BackendRow)>> {
BackendRows::next(self.deref_mut())
}
Expand Down
4 changes: 2 additions & 2 deletions butane_core/src/db/pg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ impl<'c> PgTransaction<'c> {
Error::Internal("transaction has already been consumed".to_string())
}
}
impl<'c> Debug for PgTransaction<'c> {
impl Debug for PgTransaction<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("PgTransaction")
// postgres::Transaction doesnt expose any internal state
Expand Down Expand Up @@ -421,7 +421,7 @@ impl postgres::types::ToSql for SqlVal {
postgres::types::to_sql_checked!();
}

impl<'a> postgres::types::ToSql for SqlValRef<'a> {
impl postgres::types::ToSql for SqlValRef<'_> {
fn to_sql(
&self,
requested_ty: &postgres::types::Type,
Expand Down
2 changes: 1 addition & 1 deletion butane_core/src/db/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ impl<'a> QueryAdapter<'a> {
}
}

impl<'a> BackendRows for QueryAdapter<'a> {
impl BackendRows for QueryAdapter<'_> {
fn next<'b>(&'b mut self) -> Result<Option<&'b (dyn BackendRow + 'b)>> {
Ok(self
.inner
Expand Down
2 changes: 1 addition & 1 deletion butane_core/src/migrations/adb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl<'de> Deserialize<'de> for TypeKey {

#[derive(Debug)]
struct TypeKeyVisitor;
impl<'de> Visitor<'de> for TypeKeyVisitor {
impl Visitor<'_> for TypeKeyVisitor {
type Value = TypeKey;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
formatter.write_str("serialized TypeKey")
Expand Down
4 changes: 2 additions & 2 deletions butane_core/src/migrations/fsmigrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ impl MigrationLock {

fn new_shared(path: &Path) -> Result<Self> {
let file = Self::get_file(path)?;
file.lock_shared()?;
fs2::FileExt::lock_shared(&file)?;
Ok(MigrationLock { file })
}

Expand All @@ -521,6 +521,6 @@ impl MigrationLock {
}
impl Drop for MigrationLock {
fn drop(&mut self) {
self.file.unlock().unwrap();
fs2::FileExt::unlock(&self.file).unwrap();
}
}
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ allow = [
"BSD-3-Clause",
"MIT",
"Unicode-DFS-2016",
"Unicode-3.0"
]
# The confidence threshold for detecting a license from license text.
# The higher the value, the more closely the license text must be to the
Expand Down

0 comments on commit 31f5fbd

Please sign in to comment.