projects
/
ldk-c-bindings
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cd17838
)
Handle use of `#[doc]` in the original source
author
Matt Corallo
<git@bluematt.me>
Tue, 25 Apr 2023 20:20:13 +0000
(20:20 +0000)
committer
Matt Corallo
<git@bluematt.me>
Wed, 26 Apr 2023 00:07:48 +0000
(
00:07
+0000)
c-bindings-gen/src/blocks.rs
patch
|
blob
|
history
diff --git
a/c-bindings-gen/src/blocks.rs
b/c-bindings-gen/src/blocks.rs
index 28f30026ed0810ef0263be3a8b4636a234d59b54..e419fe095abb8dd6bd5d6dc3b403090b5b664b82 100644
(file)
--- a/
c-bindings-gen/src/blocks.rs
+++ b/
c-bindings-gen/src/blocks.rs
@@
-442,7
+442,7
@@
fn writeln_docs_impl<'a, W: std::io::Write, I>(w: &mut W, attrs: &[syn::Attribut
match token_iter.next().unwrap() {
TokenTree::Literal(lit) => {
// Drop the first and last chars from lit as they are always "
match token_iter.next().unwrap() {
TokenTree::Literal(lit) => {
// Drop the first and last chars from lit as they are always "
- let doc = format!("{}", lit);
+ let doc = format!("{}", lit)
.trim().replace("\n", &format!("\n{}//!", prefix))
;
writeln!(w, "{}//!{}", prefix, &doc[1..doc.len() - 1]).unwrap();
},
_ => unimplemented!(),
writeln!(w, "{}//!{}", prefix, &doc[1..doc.len() - 1]).unwrap();
},
_ => unimplemented!(),
@@
-452,7
+452,7
@@
fn writeln_docs_impl<'a, W: std::io::Write, I>(w: &mut W, attrs: &[syn::Attribut
match token_iter.next().unwrap() {
TokenTree::Literal(lit) => {
// Drop the first and last chars from lit as they are always "
match token_iter.next().unwrap() {
TokenTree::Literal(lit) => {
// Drop the first and last chars from lit as they are always "
- let doc = format!("{}", lit);
+ let doc = format!("{}", lit)
.trim().replace("\n", &format!("\n{}///", prefix))
;
writeln!(w, "{}///{}", prefix, &doc[1..doc.len() - 1]).unwrap();
},
_ => unimplemented!(),
writeln!(w, "{}///{}", prefix, &doc[1..doc.len() - 1]).unwrap();
},
_ => unimplemented!(),