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 warnings #23

Merged
merged 1 commit into from
Aug 19, 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
2 changes: 1 addition & 1 deletion src/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub fn download_file(url: &str, file_path: &Path, redirect_path: &Path) -> Resul
let mut file = OpenOptions::new()
.create(true)
.read(true)
.write(true)
.append(true)
.open(file_path)?;

let file_size = file.metadata()?.len();
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ fn main() -> anyhow::Result<()> {
i64::from(get_last_layer_from_db(&db_file_path).or_else(|err| {
eprintln!("{}", err);
println!("Cannot read database, trating it as empty database");
return Ok::<i32, anyhow::Error>(0);
Ok::<i32, anyhow::Error>(0)
})?)
} else {
println!("Database file is not found");
Expand All @@ -156,7 +156,7 @@ fn main() -> anyhow::Result<()> {
let go_path_str = go_path
.to_str()
.expect("Cannot resolve path to go-spacemesh");
let go_version = get_version(&go_path_str)?;
let go_version = get_version(go_path_str)?;
let quicksync_layer = fetch_latest_available_layer(&download_url, &go_version)?;
println!("Latest layer in cloud: {}", quicksync_layer);
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub fn fetch_latest_available_layer(download_url: &Url, go_version: &str) -> Res
.build()?;

let path = format!("{}/state.zst", go_version);
let url = build_url(&download_url, &path);
let url = build_url(download_url, &path);

let response = client.head(url).send()?;

Expand Down
Loading