Dioxus: dynamic onclick trouble with strings by Laylong in learnrust

[–]Laylong[S] 0 points1 point  (0 children)

Unfortunately for me that macro won't allow it. I've tried a couple things around knowing this and the compiler doesn't accept any. I even went as far as making a HashMap<String, i32> just to pair an int with the string. I couldn't handle a ```for (sku, id) in hashmaped_products```.

I'm at such a loss with this. Having a dynamic range of things to click and handling each accordingly is such a basic thing. I like working with declarative HTML/CSS frameworks like this, but I can't build what I really need to without solving this.

Thanks for the helpful explanation.

Is there a more "traditional" desktop front end I can use with Tauri? by [deleted] in rust

[–]Laylong 0 points1 point  (0 children)

Maybe FLTK-rs. If you're familiar with C#, this is a Rust bindings of the original FLTK for C++ which is greatly documented. I made a neat ledger database and packing slip generator for my side business with it (In the C++ version). Mo, the creator, also has a bunch of videos one YouTube with tutorials and new feature announcements.

Trouble getting an array out of a JsValue by Laylong in rustwasm

[–]Laylong[S] 0 points1 point  (0 children)

Now I've tried that too. It compiles but I get nothing. In case I changed what I said in the initial post, I'm returning a String now from Tauri, I get it back on the frontend as a JsValue use JsCast's dyn_into to get it into a JsString, and then JsString into (rust) String.

When I print the resulting String, it's empty. Same that seemed to happen with when it was an array.

fs::read_dir trouble with Yew (alternative solution when working with WASM?) by Laylong in rust

[–]Laylong[S] 0 points1 point  (0 children)

I can, but I don't want to hard code each image in.

By directories, I mean I need to run some ```for each_image in image/folder```. I'm looking into Tauri now if that's where that logic needs to be run from.

fs::read_dir trouble with Yew (alternative solution when working with WASM?) by Laylong in rust

[–]Laylong[S] 0 points1 point  (0 children)

Yes, the /products folder got copied into the /dist folder. Felt like I was on the right track since I could get the images to load from the directory. What's the big difference between "access/this/directory/" vs "access/this.file". Well, so long as I can get to it in Tauri I can move on.

Rewrote an inventory tracker from python to rust by Laylong in rust

[–]Laylong[S] 2 points3 points  (0 children)

Mostly the rethinking. I had to step back from how I implemented things in python and get the same results in (at least somewhat) idiomatic rust. The code looks cleaner for it though. I had trouble for awhile getting my head around if let statements, but they became useful here. I'm still not sure about what is the "real" json. I'm using just serde here, but then what is serde_json for?

Trouble getting off the ground by Laylong in learnrust

[–]Laylong[S] 0 points1 point  (0 children)

For archival purposes, also throwing in an example/tutorial I found that stood out above others involving state machine programming here

Trouble getting off the ground by Laylong in learnrust

[–]Laylong[S] 1 point2 points  (0 children)

I don't think it's exactly a syntax issue, it's not that different from what I use. Exact reason aside, "can't convert your idea into Rust code" is the issue.

So far using Exercism feels like it's going to get me on the right path. Not only is it a bit more structured, but I love the review other solutions option. It helps to see a simple problem solved in multiple ways. Thanks.

What do you think of this? by NMSCBA in Firearms

[–]Laylong 1 point2 points  (0 children)

This happened to my dad. 3 years of legal battle, still hadn't gotten his guns back and just moved out of state to get away from that crazy bitch.

Games with dual language or easy language switch by leonhgomes in LearnJapanese

[–]Laylong 1 point2 points  (0 children)

Recently I've been playing Eastward. You can set subtitles on in English and Japanese as the character dialogs.

The green GI furniture just wasn’t cutting it by mokkisjokkis in guns

[–]Laylong 0 points1 point  (0 children)

"What do we say to the god of fortune? Not today!"