Skip to content

Commit 2d531d1

Browse files
committed
Merge remote-tracking branch 'origin/master' into next
2 parents ad5f6ee + 7e1bd3b commit 2d531d1

File tree

7 files changed

+35
-11
lines changed

7 files changed

+35
-11
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
* Non-breaking changes:
2222
+ Supports parsing the arguments' names for `func` and `service` (init args).
2323

24+
## 2025-08-04
25+
26+
### Candid 0.10.17
27+
28+
* Non-breaking changes:
29+
+ Fixes a regression in pretty printing when concatenating an empty list of documents
30+
2431
## 2025-07-29
2532

2633
### Candid 0.10.16

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/bench/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/candid/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "candid"
33
# sync with the version in `candid_derive/Cargo.toml`
4-
version = "0.10.16"
4+
version = "0.10.17"
55
edition = "2021"
66
rust-version.workspace = true
77
authors = ["DFINITY Team"]
@@ -16,7 +16,7 @@ keywords = ["internet-computer", "idl", "candid", "dfinity"]
1616
include = ["src", "Cargo.toml", "LICENSE", "README.md"]
1717

1818
[dependencies]
19-
candid_derive = { path = "../candid_derive", version = "=0.10.16" }
19+
candid_derive = { path = "../candid_derive", version = "=0.10.17" }
2020
ic_principal = { path = "../ic_principal", version = "0.1.0" }
2121
binread = { version = "2.2", features = ["debug_template"] }
2222
byteorder = "1.5.0"

rust/candid/src/pretty/utils.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ pub fn concat<'a, D>(docs: D, sep: &'a str) -> RcDoc<'a>
5555
where
5656
D: Iterator<Item = RcDoc<'a>>,
5757
{
58+
let mut docs = docs.peekable();
59+
if docs.peek().is_none() {
60+
return RcDoc::nil();
61+
}
5862
let singleline = RcDoc::intersperse(docs, RcDoc::text(sep).append(RcDoc::line()));
5963
let multiline = singleline.clone().append(sep);
6064
multiline.flat_alt(singleline)
@@ -85,3 +89,16 @@ pub fn quote_ident(id: &str) -> RcDoc {
8589
.append("'")
8690
.append(RcDoc::space())
8791
}
92+
93+
#[cfg(test)]
94+
mod test {
95+
use super::*;
96+
97+
#[test]
98+
fn concat_empty() {
99+
let t = concat(vec![].into_iter(), ",")
100+
.pretty(LINE_WIDTH)
101+
.to_string();
102+
assert_eq!(t, "");
103+
}
104+
}

rust/candid_derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "candid_derive"
33
# sync with the version in `candid/Cargo.toml`
4-
version = "0.10.16"
4+
version = "0.10.17"
55
edition = "2021"
66
rust-version.workspace = true
77
authors = ["DFINITY Team"]

tools/didc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "didc"
3-
version = "0.5.0"
3+
version = "0.5.1"
44
authors = ["DFINITY Team"]
55
edition = "2021"
66

0 commit comments

Comments
 (0)