Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clippy errors after Rust update #1361

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions extensions/scarb-doc/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// TODO(drknzz): Remove if not needed.
#![allow(dead_code)]

use cairo_lang_defs::db::DefsGroup;
use cairo_lang_defs::ids::{
ConstantId, EnumId, ExternFunctionId, ExternTypeId, FreeFunctionId, ImplAliasId, ImplDefId,
Expand Down
12 changes: 5 additions & 7 deletions scarb/src/sources/git/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ impl fmt::Debug for GitDatabase {

/// A local checkout of a particular Git commit.
#[derive(Debug)]
pub struct GitCheckout<'d> {
pub db: &'d GitDatabase,
pub struct GitCheckout {
pub location: Utf8PathBuf,
pub rev: Rev,
}
Expand Down Expand Up @@ -202,7 +201,7 @@ impl GitDatabase {
exec(&mut cmd, config)
}

pub fn copy_to(&self, fs: &Filesystem, rev: Rev, config: &Config) -> Result<GitCheckout<'_>> {
pub fn copy_to(&self, fs: &Filesystem, rev: Rev, config: &Config) -> Result<GitCheckout> {
// If the checkout exists, the rev matches, and is marked ok, use it.
// A non-ok checkout can happen if the checkout operation was
// interrupted. In that case, the checkout gets deleted and a new
Expand All @@ -219,7 +218,6 @@ impl GitDatabase {
{
debug!("git checkout ready; skipping clone; fs={fs}");
return Ok(GitCheckout {
db: self,
location: fs.path_existent()?.to_path_buf(),
rev,
});
Expand Down Expand Up @@ -280,9 +278,9 @@ impl GitDatabase {
}
}

impl<'d> GitCheckout<'d> {
impl GitCheckout {
#[tracing::instrument(level = "trace", skip(config))]
fn clone(db: &'d GitDatabase, fs: &Filesystem, rev: Rev, config: &Config) -> Result<Self> {
fn clone(db: &GitDatabase, fs: &Filesystem, rev: Rev, config: &Config) -> Result<Self> {
unsafe {
fs.recreate()?;
}
Expand All @@ -298,7 +296,7 @@ impl<'d> GitCheckout<'d> {
cmd.arg(&location);
exec(&mut cmd, config)?;

Ok(Self { db, location, rev })
Ok(Self { location, rev })
}

#[tracing::instrument(level = "trace", skip(config))]
Expand Down
4 changes: 4 additions & 0 deletions utils/test-for-each-example/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// TODO(maciektr): Remove when `darling` gets fixed.
// See: https://github.com/TedDriggs/darling/pull/292
#![allow(clippy::manual_unwrap_or_default)]

use proc_macro::TokenStream;
use std::path::Path;

Expand Down
Loading