Synphonyte / leptos-struct-table

Easily create Leptos table components from structs
Apache License 2.0
164 stars 24 forks source link

default table row renderer bug? #16

Closed zoakes closed 9 months ago

zoakes commented 9 months ago

I'm new to the repo, but struggling to get (most) of the examples to run. The exception so far is the custom_renderer_svg, which uses an overriden renderer. This is a bit beyond my familiarity to diagnose, but it seems like it just needs a Clone requirement, or a slight deviation in the DefaultTableRowRenderer impl. At a glance it doesn't seem to be missing Clones anywhere, unsure.

Here is the error I seem to get in most other examples:

error[E0283]: type annotations needed
  --> src/main.rs:12:10
   |
12 | #[derive(TableComponent, Serialize, Deserialize, Debug, Clone, Default, PartialEq)]
   |          ^^^^^^^^^^^^^^ cannot infer type
   |
   = note: cannot satisfy `_: Clone`
note: required by a bound in `leptos_struct_table::DefaultTableRowRenderer`
  --> /Users/zoakes/RustroverProjects/leptos-struct-table/src/components/row.rs:39:9
   |
18 | pub fn DefaultTableRowRenderer<K, F, RV>(
   |        ----------------------- required by a bound in this function
...
39 |     RV: Clone + Default + 'static,
   |         ^^^^^ required by this bound in `DefaultTableRowRenderer`
   = note: this error originates in the derive macro `TableComponent` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0283`.
error: could not compile `generic` (bin "generic") due to 1 previous error
maccesch commented 9 months ago

What version are you using?

zoakes commented 9 months ago

cloned repo -- Master branch, latest.

WRT Rust, 1.78 nightly

➜ custom_renderers_svg git:(master) ✗ cargo --version cargo 1.78.0-nightly (7bb7b5395 2024-01-20) ➜ custom_renderers_svg git:(master) ✗ rustup --version rustup 1.26.0 (5af9b9484 2023-04-05) info: This is the version for the rustup toolchain manager, not the rustc compiler. info: The currently active rustc version is rustc 1.78.0-nightly (b11fbfbf3 2024-02-03) ➜ custom_renderers_svg git:(master) ✗ rustc --version rustc 1.78.0-nightly (b11fbfbf3 2024-02-03)

zoakes commented 9 months ago

I realized if I go back to the release 0.6 commit, and run -- seems to be fine. Unsure of how Master is treated wrt convention in this repo.

So, I can certainly fork off there if needed, or download the release version.

maccesch commented 9 months ago

Yeah using the release would be my recommendation. I'm in the final stages of a major refactoring so master is not necessarily stable right now. Will release soon!

zoakes commented 9 months ago

Understood — thanks!

Get Outlook for iOShttps://aka.ms/o0ukef


From: Marc-Stefan Cassola @.> Sent: Monday, February 5, 2024 1:26:19 PM To: Synphonyte/leptos-struct-table @.> Cc: Zach Mazz @.>; Author @.> Subject: Re: [Synphonyte/leptos-struct-table] default table row renderer bug? (Issue #16)

Closed #16https://github.com/Synphonyte/leptos-struct-table/issues/16 as completed.

— Reply to this email directly, view it on GitHubhttps://github.com/Synphonyte/leptos-struct-table/issues/16#event-11708919648, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALPUCIG7KUSFPJM3DCZZ57TYSEW5XAVCNFSM6AAAAABCZDI6HGVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRG4YDQOJRHE3DIOA. You are receiving this because you authored the thread.Message ID: @.***>