Closed thomassimmer closed 6 months ago
And yes, don't worry about merge conflicts.
Am I wrong that with your changes display_with
will also support arguments like self.field1
.
I bet I am not.
And I bet it's good.
Just need to document and create tests.
Am I wrong that with your changes
display_with
will also support arguments likeself.field1
. I bet I am not.And I bet it's good.
Just need to document and create tests.
You are right! I added one test, let me know if it's fine.
Hey @thomassimmer
I'll merge it, will add a few more things, and release hopefully soon.
But could you let me know your thoughts on this tuple
thing?
It seems perfectly good to me.
#[test]
fn format3() {
#[derive(Debug, Tabled)]
struct StructName(u8, #[tabled(format("foo {} {:?}", 2, self))] String);
let value = StructName(0, String::from("string"));
assert_eq!(value.fields(), vec!["0", "foo 2 StructName(0, \"string\")"]);
assert_eq!(StructName::headers(), vec!["0", "1"]);
}
Thanks for contribution. And take care.
Hey @thomassimmer
I'll merge it, will add a few more things, and release hopefully soon.
But could you let me know your thoughts on this
tuple
thing? It seems perfectly good to me.#[test] fn format3() { #[derive(Debug, Tabled)] struct StructName(u8, #[tabled(format("foo {} {:?}", 2, self))] String); let value = StructName(0, String::from("string")); assert_eq!(value.fields(), vec!["0", "foo 2 StructName(0, \"string\")"]); assert_eq!(StructName::headers(), vec!["0", "1"]); }
Thanks for contribution. And take care.
Hi @zhiburt ,
What you said on tuples sounds good to me too!
Thank you for merging and take care.
Hello,
This is for #396 .
I hope it's fine, it was probably a bit too difficult for me as a first issue. I tried to do something very similar to display_with but I encounter some difficulties with properties and nested structs/enums. I would be happy to see what corrections you can make to improve it.
By the way, thanks a lot for the library! :)
FYI, I needed that for this project : https://github.com/thomassimmer/NeoPass
Cheers