Skip to content

Commit 61c650c

Browse files
authored
Merge pull request #1377 from LukasKalbertodt/master
Update to litrs 1.0
2 parents 01d3346 + 26bad2e commit 61c650c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ which = "7"
3939
# * quote: 1.0.37 allows tokenizing CStr.
4040
# * venial: 0.6.1 contains some bugfixes.
4141
heck = "0.5"
42-
litrs = "0.4"
42+
litrs = { version = "1.0", features = ["proc-macro2"] }
4343
markdown = "=1.0.0-alpha.23"
4444
nanoserde = "0.2"
4545
proc-macro2 = "1.0.80"

godot-macros/src/docs/extract_docs.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,8 @@ fn extract_docs_from_attributes(doc: &[venial::Attribute]) -> impl Iterator<Item
115115
})
116116
.flat_map(|doc| {
117117
doc.iter().map(|token_tree| {
118-
let str = token_tree.to_string();
119-
litrs::StringLit::parse(str.clone())
120-
.map_or(str, |parsed| parsed.value().to_string())
118+
litrs::StringLit::try_from(token_tree)
119+
.map_or_else(|_| token_tree.to_string(), |parsed| parsed.into_value())
121120
})
122121
})
123122
}

0 commit comments

Comments
 (0)