That would solve the problem. But maybe you should define a structure with the example data and serialize it to automatically stay in sync with changes to the data structures? Otherwise the documentation might diverge.

On Wed, Mar 13, 2019, 16:30 Sebastian Geisler ***@***.*** wrote:
***@***.**** requested changes on this pull request.
That would solve the problem. But maybe you should define a structure with
the example data and serialize it to automatically stay in sync with
changes to the data structures? Otherwise the documentation might diverge.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA0F3HpuhXozwYZBAK61O2HTJl4tXvzMks5vWSeXgaJpZM4btE4->
.

Having spent some hours trying to solve this problem I'd say this PR is good enough in principle. I actually tried out the example and it complained about some trailing commas but works if one removes them. After that is fixed I'd ACK.

[1] Why did they choose S: Into<&'a str>? That makes no sense, that means since Into defines fn into(self) -> &T that S can never own the underlying string object, it always has to already have a reference with lifetime 'a. They really should have chosen S: AsRef<str> or built it around Cow.

This comment has been minimized.

On Sun, Mar 17, 2019, 07:46 Sebastian Geisler ***@***.*** wrote:
***@***.**** requested changes on this pull request.
I don't think you can put owned strings into there though.
You are right, clap's API is a PITA. [1 rant moved to end of text]
Having spent some hours trying to solve this problem I'd say this PR is
good enough in principle. I actually tried out the example and it
complained about some trailing commas but works if one removes them. After
that is fixed I'd ACK.
The following version works for me:
{
"version": 1,
"locktime": 0,
"inputs": [
{
"prevout": "78a0f5b35b73f1f6e054274aa3904867774600f09bd194e97e7a0fd953b27c54:6",
"script_sig": {
"hex":
"483045022100fad8d9b44d1d3a86bd9719ef642b32ed0a1c8f4e3de4e2009936988f73f12ad702207a2204cbdfd166d099cbb08e6c7886db5b986ef4fdfee383c1b8fc4df82ecea80121030a696d89d161c086586cf0de7d98fb97181a1ee0265130f7ddbecd17d616c780"
},
"sequence": 4294967295
},
{
"txid": "c182fa9182957c5b906fd2b339d7a01dd110340bced99e049e2bd2c135f4513a",
"vout": 1,
"script_sig": {
"hex": "220020fa28dc1e5eb222055e90f8cade9bcd13ca9ddab7a5ed029e27d41a736f7455ce"
},
"sequence": 4294967294,
"witness": [
"",
"30440220725e1c098d85013166fae52794811f6531ff3962ea6bc3228ecfdd4699ae669b022064d5c88f2b838968a345681bbfeb2c09f0433ece511bc4d139c4805adf59d74601",
"3044022055aa0f675bf0c21e113527f838b93d5922143ae6e52b094416d44551ff6d236202205ef3773cc9a7fe2076310c92adc73670747309265ecedb0cffe194885a89863601",
"5221027111c0d6cbc3a40c6e6197ed234bd6e59f277c88094fd33297b1e0a3787a5b7d2102e71711c9840d68e6401d4bd5df78f1850e25ae41f082f4b38ceec37d60cab5442103eeae18900c0d12046f644b960a1ef84589f7f4f71d07914006d550bf85c576e153ae"
]
}
],
"outputs": [
{
"value": 500000,
"script_pub_key": {
"hex": "a91405394a3a5dedce4f945ed9f650fa9ff23f011d4687"
}
},
{
"value": 2590000,
"script_pub_key": {
"address": "34nFYcfPNTuWCV76YrwdVc4MyXmeVMMpsZ"
}
}
]
}
[1] Why did they choose S: Into<&'a str>? That makes no sense, that means
since Into defines fn into(self) -> &T that S can never own the
underlying string object, it always has to already have a reference with
lifetime 'a. They really should have chosen S: AsRef<str> or built it
around Cow.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA0F3FHQssgN-eVkyVcJYS1rT4m8iKo9ks5vXfK3gaJpZM4btE4->
.

Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.