Skip to content

Commit 636b638

Browse files
authored
Merge pull request #44 from firefly-zero/upd-deps-2
Update all deps
2 parents ac814cb + 31fe2bc commit 636b638

File tree

12 files changed

+253
-197
lines changed

12 files changed

+253
-197
lines changed

Cargo.lock

+204-151
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+19-18
Original file line numberDiff line numberDiff line change
@@ -19,51 +19,52 @@ categories = [
1919

2020
[dependencies]
2121
# Simpler error handling
22-
anyhow = "1.0.95"
23-
# Get current date and time.
24-
chrono = { version = "0.4.39", default-features = false, features = ["clock"] }
22+
anyhow = "1.0.98"
23+
# Get current date and time
24+
chrono = { version = "0.4.41", default-features = false, features = ["clock"] }
2525
# Framework for parsing CLI args
26-
clap = { version = "4.5.29", features = ["derive"] }
26+
clap = { version = "4.5.37", features = ["derive"] }
2727
# Detect message boundaries in serial port output from device
2828
cobs = "0.3.0"
2929
# TUI for the "monitor" command, colored terminal output
30-
crossterm = "0.28.1"
30+
crossterm = "0.29.0"
3131
# Convert binary hash into hex
32-
data-encoding = "2.8.0"
32+
data-encoding = "2.9.0"
3333
# Find the best place to sotre the VFS
3434
directories = "6.0.0"
3535
# Serialize app config into meta file in the ROM
3636
firefly-types = { version = "0.5.1" }
3737
# Decode wav files
3838
hound = "3.5.1"
3939
# Parse PNG images
40-
image = { version = "0.25.5", default-features = false, features = ["png"] }
40+
image = { version = "0.25.6", default-features = false, features = ["png"] }
4141
# Random device name generation
4242
rand = "0.8.5"
4343
# Signatures
44-
rsa = { version = "0.9.7", default-features = false, features = [
44+
rsa = { version = "0.9.8", default-features = false, features = [
4545
"std",
4646
"sha2",
4747
] }
48-
rust-embed = { version = "8.5.0", default-features = false, features = [
48+
rust-embed = { version = "8.7.1", default-features = false, features = [
4949
"debug-embed",
5050
] }
5151
# REPL
5252
rustyline = "15.0.0"
5353
# Deserialize firefly.toml (required by `toml`)
54-
serde = { version = "1.0.217", features = ["serde_derive", "derive"] }
55-
# Deserialize JSON API responses from the firefly catalog.
56-
serde_json = "1.0.138"
57-
serialport = "4.7.0"
54+
serde = { version = "1.0.219", features = ["serde_derive", "derive"] }
55+
# Deserialize JSON API responses from the firefly catalog
56+
serde_json = "1.0.140"
57+
# Communicating with running device
58+
serialport = "4.7.1"
5859
# Calculate file checksum
59-
sha2 = "0.10.8"
60+
sha2 = "0.10.9"
6061
# Deserialize firefly.toml
61-
toml = "0.8.20"
62+
toml = "0.8.22"
6263
# Download remote files (`url` field in `firefly.toml`)
6364
ureq = "2.12.1"
6465
# Build together post-processed wasm binaries
65-
wasm-encoder = "0.225.0"
66+
wasm-encoder = "0.230.0"
6667
# Parse wasm binaries for post-processing (removing custom sections)
67-
wasmparser = "0.225.0"
68+
wasmparser = "0.230.0"
6869
# Work with zip archives (distribution format for ROMs)
69-
zip = { version = "2.2.2", default-features = false, features = ["zstd"] }
70+
zip = { version = "2.6.1", default-features = false, features = ["zstd"] }

src/commands/badges.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fn display_badges(
4646
continue;
4747
}
4848
print!("{}", "[hidden] ".grey());
49-
};
49+
}
5050
println!("#{id} {} ({} XP)", badge.name.cyan(), badge.xp);
5151
println!("{}", badge.descr);
5252
let emoji = if progress.earned() {

src/commands/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ fn remove_old_files(root: &Path) -> anyhow::Result<()> {
165165
continue;
166166
}
167167
fs::remove_file(entry.path())?;
168-
};
168+
}
169169
}
170170
Ok(())
171171
}

src/commands/cheat.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub fn cmd_cheat(args: &CheatArgs) -> Result<()> {
3838
fn parse_command(raw: &str, root: &Path) -> Result<i32> {
3939
if let Ok(n) = raw.parse::<i32>() {
4040
return Ok(n);
41-
};
41+
}
4242
let config = Config::load(root.into(), root).context("load project config")?;
4343
let Some(cheats) = config.cheats else {
4444
bail!("firefly.toml doesn't have [cheats]")

src/commands/inspect.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ fn inspect_images(rom_path: &Path) -> anyhow::Result<Vec<ImageStats>> {
133133
let entry = entry?;
134134
if let Some(stat) = inspect_image(&entry.path()) {
135135
stats.push(stat);
136-
};
136+
}
137137
}
138138
Ok(stats)
139139
}
@@ -203,7 +203,7 @@ fn inspect_audios(rom_path: &Path) -> anyhow::Result<Vec<AudioStats>> {
203203
let entry = entry?;
204204
if let Some(stat) = inspect_audio(&entry.path()) {
205205
stats.push(stat);
206-
};
206+
}
207207
}
208208
Ok(stats)
209209
}

src/commands/keys.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ pub fn cmd_key_add(vfs: &Path, args: &KeyArgs) -> anyhow::Result<()> {
158158

159159
/// Download the key from the given URL.
160160
fn download_key(url: &str) -> anyhow::Result<(String, Vec<u8>)> {
161-
let file_name = url.split('/').last().unwrap();
161+
let file_name = url.split('/').next_back().unwrap();
162162
let Some(author) = file_name.strip_suffix(".der") else {
163163
bail!("the key file must have .der extension")
164164
};
@@ -195,7 +195,7 @@ fn save_raw_key(vfs: &Path, author: &str, raw_key: &[u8]) -> anyhow::Result<()>
195195
} else {
196196
RsaPublicKey::from_pkcs1_der(raw_key).context("parse public key")?;
197197
fs::write(pub_path, raw_key).context("write public key")?;
198-
};
198+
}
199199
Ok(())
200200
}
201201

src/commands/logs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn cmd_logs(args: &LogsArgs) -> Result<()> {
3333
Ok(Response::Log(log)) => println!("{log}"),
3434
Ok(_) => (),
3535
Err(err) => println!("invalid message: {err}"),
36-
};
36+
}
3737
}
3838
}
3939
}

src/commands/monitor.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ fn request_device_stats(port: &mut Port, stats: &mut Stats) -> Result<()> {
151151
let buf = req.encode_vec().context("encode request")?;
152152
port.write_all(&buf[..]).context("send request")?;
153153
port.flush().context("flush request")?;
154-
};
154+
}
155155
Ok(())
156156
}
157157

@@ -179,7 +179,7 @@ fn parse_stats(stats: &mut Stats, buf: &[u8]) -> Result<()> {
179179
}
180180
}
181181
serial::Response::Memory(mem) => stats.mem = Some(mem),
182-
};
182+
}
183183
Ok(())
184184
}
185185

@@ -245,19 +245,19 @@ fn render_stats(stats: &Stats) -> Result<()> {
245245
execute!(io::stdout(), terminal::Clear(terminal::ClearType::All))?;
246246
if let Some(cpu) = &stats.cpu {
247247
render_cpu(cpu).context("render cpu table")?;
248-
};
248+
}
249249
if let Some(fuel) = &stats.update {
250250
render_fuel(1, 7, "update", fuel).context("render fuel table")?;
251-
};
251+
}
252252
if let Some(fuel) = &stats.render {
253253
render_fuel(24, 7, "render", fuel).context("render fuel table")?;
254-
};
254+
}
255255
if let Some(memory) = &stats.mem {
256256
render_memory(memory).context("render memory table")?;
257-
};
257+
}
258258
if let Some(log) = &stats.log {
259259
render_log(log).context("render logs")?;
260-
};
260+
}
261261
Ok(())
262262
}
263263

src/commands/new.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn cmd_new(args: &NewArgs) -> Result<()> {
1919
let root = Path::new(&args.name);
2020
if root.exists() {
2121
bail!("the directory already exists");
22-
};
22+
}
2323
let lang = parse_lang(&args.lang)?;
2424
match lang {
2525
Lang::Go => new_go(&args.name).context("new Go project")?,
@@ -38,15 +38,17 @@ pub fn cmd_new(args: &NewArgs) -> Result<()> {
3838

3939
/// Create and dump firefly.toml config.
4040
fn write_config(name: &str) -> Result<()> {
41+
use std::fmt::Write;
42+
4143
let root = Path::new(name);
4244
let config_path = root.join("firefly.toml");
4345
let username = get_username().unwrap_or_else(|| "joearms".to_string());
4446

4547
let mut config = String::new();
46-
config.push_str(&format!("author_id = \"{username}\"\n"));
47-
config.push_str(&format!("app_id = \"{name}\"\n"));
48-
config.push_str(&format!("author_name = \"{}\"\n", to_titlecase(&username)));
49-
config.push_str(&format!("app_name = \"{}\"\n", to_titlecase(name)));
48+
_ = writeln!(config, "author_id = \"{username}\"");
49+
_ = writeln!(config, "app_id = \"{name}\"");
50+
_ = writeln!(config, "author_name = \"{}\"", to_titlecase(&username));
51+
_ = writeln!(config, "app_name = \"{}\"", to_titlecase(name));
5052

5153
std::fs::write(config_path, config).context("write config")?;
5254
Ok(())

src/langs.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,11 @@ fn find_rust_result(root: &Path) -> anyhow::Result<PathBuf> {
180180
let release_dir = target_dir.join("wasm32-unknown-unknown").join("release");
181181
if let Some(path) = find_wasm_binary(&release_dir)? {
182182
return Ok(path);
183-
};
183+
}
184184
let examples_dir = release_dir.join("examples");
185185
if let Some(path) = find_wasm_binary(&examples_dir)? {
186186
return Ok(path);
187-
};
187+
}
188188
bail!("cannot find wasm binary")
189189
}
190190

@@ -246,7 +246,7 @@ fn build_cpp_inner(config: &Config, bin_name: &str, fname: &str) -> anyhow::Resu
246246
in_path = in_path_src;
247247
if !in_path.exists() {
248248
bail!("file {fname} not found");
249-
};
249+
}
250250
}
251251
let out_path = config.rom_path.join(BIN);
252252
let wasi_sysroot = wasi_sdk.join("share").join("wasi-sysroot");
@@ -372,6 +372,8 @@ pub fn check_output(output: &Output) -> anyhow::Result<()> {
372372

373373
/// Run the given binary with the given arg and return an error if it is not installed.
374374
pub fn check_installed(lang: &str, bin: &str, arg: &str) -> anyhow::Result<()> {
375+
use std::fmt::Write;
376+
375377
let output = Command::new(bin).args([arg]).output();
376378
if let Ok(output) = output {
377379
if output.status.success() {
@@ -380,9 +382,7 @@ pub fn check_installed(lang: &str, bin: &str, arg: &str) -> anyhow::Result<()> {
380382
}
381383
let mut msg =
382384
format!("You're trying to build a {lang} app but you don't have {bin} installed.\n");
383-
msg.push_str(&format!(
384-
"Please, follow the getting started guide for {lang}:\n"
385-
));
386-
msg.push_str(" https://docs.fireflyzero.com/dev/getting-started/");
385+
_ = writeln!(msg, "Please, follow the getting started guide for {lang}:");
386+
_ = write!(msg, " https://docs.fireflyzero.com/dev/getting-started/");
387387
bail!(msg);
388388
}

src/net.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn connect() -> Result<TcpStream> {
1616
if maybe_stream.is_err() {
1717
sleep(Duration::from_secs(1));
1818
maybe_stream = TcpStream::connect(&addrs[..]);
19-
};
19+
}
2020
let stream = maybe_stream.context("connect to emulator")?;
2121
Ok(stream)
2222
}

0 commit comments

Comments
 (0)