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

Rust update - fix build and clippy erorrs #1213

Merged
merged 1 commit into from
Mar 22, 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
1 change: 1 addition & 0 deletions scarb/src/core/registry/client/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ fn edit_records(records_path: &Path, func: impl FnOnce(&mut IndexRecords)) -> Re
.read(true)
.write(true)
.create(true)
.truncate(false)
mkaput marked this conversation as resolved.
Show resolved Hide resolved
.open(records_path)
.context("failed to open file")?;

Expand Down
9 changes: 6 additions & 3 deletions scarb/src/flock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ pub struct AdvisoryLock<'f> {
config: &'f Config,
}

#[derive(Debug)]
pub struct AdvisoryLockGuard(Arc<FileLockGuard>);
pub struct AdvisoryLockGuard {
_inner: Arc<FileLockGuard>,
}

impl<'f> AdvisoryLock<'f> {
/// Acquires this advisory lock in an async manner.
Expand All @@ -172,7 +173,9 @@ impl<'f> AdvisoryLock<'f> {
arc
}
};
Ok(AdvisoryLockGuard(file_lock_arc))
Ok(AdvisoryLockGuard {
_inner: file_lock_arc,
})
}
}

Expand Down
1 change: 1 addition & 0 deletions scarb/src/ops/lockfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub fn read_lockfile(ws: &Workspace<'_>) -> Result<Lockfile> {
.read(true)
.write(true)
.create(true)
.truncate(false)
mkaput marked this conversation as resolved.
Show resolved Hide resolved
.open(ws.lockfile_path())
.context("failed to open lockfile")?;

Expand Down
5 changes: 4 additions & 1 deletion utils/scarb-build-metadata/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ fn cairo_version() {
.root
.expect("Expected metadata resolve root to be present.");
assert!(
root.repr.starts_with("scarb "),
// The first condition for Rust >= 1.77
// (After the PackageId spec stabilization)
// The second condition for Rust < 1.77
root.repr.contains("scarb#") || root.repr.starts_with("scarb "),
"Expected metadata resolve root to be `scarb`."
);

Expand Down
Loading