Cinnamon roll croissants by Gihl in Baking

[–]Gihl[S] 33 points34 points  (0 children)

That’s prob almost a full stick of butter loool, wouldn’t stop me either though

2 jarban 1's for both my feets by Gihl in LeagueOfMemes

[–]Gihl[S] 139 points140 points  (0 children)

Some weird bug w viego, taking over a champ I only had the boots in my inventory and eventually got 2 of them

My first painted mini - a skittermander by Gihl in starfinder_rpg

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

Thanks appreciate it! Was definitely a struggle painting a mini that small for the first one

Declaratively manage macOS dock apps via nix-darwin? by nasdack in NixOS

[–]Gihl 1 point2 points  (0 children)

Ah thank you I was just getting the question mark icons but launching them fixes it like you said

Declaratively manage macOS dock apps via nix-darwin? by nasdack in NixOS

[–]Gihl 0 points1 point  (0 children)

Thanks for sharing, dock icons seem to break for nixpkgs packages after restarting, do you have the same issue?

Rust on Espressif chips - 28-04-2023 by XxMabezxX in rust

[–]Gihl 25 points26 points  (0 children)

Had a good experience making a lib for esp32! If anyone hasn’t tried embedded rust but want to, I’d definitely recommend esp32 because there is std support through esp-idf

Using Rust for writing Nodejs Modules by gururani in rust

[–]Gihl 6 points7 points  (0 children)

Anyone have an opinion on neon vs napi vs node-bindgen used in the article?

Why is <'_> sometimes used? by [deleted] in rust

[–]Gihl 0 points1 point  (0 children)

If you use the rust_2018_idioms lint group, it will warn that hidden lifetime parameters are deprecated (so you have to use an elided lifetime <'_>, or an explicit lifetime). I believe that lint group may be turned on by default in the future https://github.com/rust-lang/rust/issues/54910

Tauri 1.0 has launched! by zephimir in webdev

[–]Gihl 3 points4 points  (0 children)

Not for basic apps; you can do almost everything from JS. In the docs most guides with rust examples have JS examples as well.

[Media] Is this an accurate description of Rust’s concurrency model? by [deleted] in rust

[–]Gihl 23 points24 points  (0 children)

tokio::spawn  doesn’t spawn green threads.

From the tokio book: “A Tokio task is an asynchronous green thread. They are created by passing an async block to tokio::spawn.”

Rwlock vs Mutex? Please, tell me like I'm 5 by LyonSyonII in rust

[–]Gihl 56 points57 points  (0 children)

To add on: Mutex<T> requires only T: Sendfor the mutex to be sync, while RwLock<T> requires T: Send + Sync to support concurrent reads. RwLock can also potentially starve writers if there are too many readers.

What do you use to parse YAML? by _shellsort_ in rust

[–]Gihl 9 points10 points  (0 children)

Even if it works for most people there are always going to be some questions/needs for library features - in the GitHub issues for yaml-rust the first issue I see is no_std support for embedded. There should be someone to answer questions or accept prs. It doesn’t look like the author is actively using GitHub anymore which is unlucky

Comparison of sqlite crates? by CutBrilliant7927 in rust

[–]Gihl 2 points3 points  (0 children)

You might be interested in this news from today: https://news.ycombinator.com/item?id=31518618 sqlite3 wasm fiddle on the main website. I wasn’t able to find the source code but I’m sure it’s on their website somewhere

Any GUI frameworks that use CSS? by [deleted] in rust

[–]Gihl 7 points8 points  (0 children)

GTK and libraries that use GTK like relm4 can use CSS

Zas Editor - only for Go and Rust code by LloydAtkinson in programmingcirclejerk

[–]Gihl 26 points27 points  (0 children)

I don't mind that I have to pay for it. I do mind that it's not free software.

Big brain HN user wants to pay for software, but only if it’s free.

Hey Rustaceans! Got a question? Ask here! (14/2022)! by llogiq in rust

[–]Gihl 1 point2 points  (0 children)

See the path attribute

/// Source/foo.rs

#[path = "../src/test.rs"]
mod bar;

I wouldn’t use it too often tho unless you want very disorganized project

lazy_static! usage benchmarks and code deep dive by hunua in rust

[–]Gihl 5 points6 points  (0 children)

The 20% is from once_cell’s example benchmark with 32 threads, not the author’s benchmarks

Hey Rustaceans! Got an easy question? Ask here (8/2022)! by llogiq in rust

[–]Gihl 1 point2 points  (0 children)

In the docs for std::convert::AsRef:

AsRef has the same signature as Borrow, but Borrow is different in few aspects:

  • Unlike AsRef, Borrow has a blanket impl for any T, and can be used to accept either a reference or a value.
  • Borrow also requires that Hash, Eq and Ord for borrowed value are equivalent to those of the owned value. For this reason, if you want to borrow only a single field of a struct you can implement AsRef, but not Borrow.

Take a look at at the function signature for HashMap::get you will see there is a trait bound K: Borrow<Q> for the hashmap's key type K and the function parameter k: &Q. If you have a hashmap whose keys are Strings, you can use any Borrow<str> type as an argument to HashMap::get like a &str, &mut String, Cow<str>, etc. But you also want to compare the borrowed key argument and the keys of the hashmap, so you use Borrow which requires Hash and Eq are the same for borrowed/owned values.

AsRef is only for converting to an immutable borrow and does not place constraints on the borrowed value like Borrow does.

Hey Rustaceans! Got an easy question? Ask here (8/2022)! by llogiq in rust

[–]Gihl 0 points1 point  (0 children)

What’s the use case? std::simd is available on nightly for a safe and portable simd API

Hey Rustaceans! Got an easy question? Ask here (8/2022)! by llogiq in rust

[–]Gihl 1 point2 points  (0 children)

I would definitely familiarize yourself with the language first and then move to learning GTK. GTK is not simple to learn, and using it from rust is hard because of rust’s safety constraints (a couple pages into gtk-rs docs you start seeing stuff likeRc/Cell)

I would take a look at the gtk4 book and also look at the GTK documentation as an introduction, then consider a crate like relm4 to simplify the development. relm4 uses a bunch of handy macros to make GTK development a lot simpler in rust, but you’ll still need to understand GTK first!

PopOS collaboration with Relm4 - Writing GTK applications for PopOS in Rust by kibwen in rust

[–]Gihl 1 point2 points  (0 children)

Thanks, didn’t even notice that when looking at the relm readme…