What is Nostr?
Mo :ferris: :tux: @ FOSDEM /
npub1j7f…mapy
2024-09-06 16:46:51

Mo :ferris: :tux: @ FOSDEM on Nostr: Did you know that spawning a thread can fail? Rust allows you to handle such an OS ...

Did you know that spawning a thread can fail?

Rust allows you to handle such an OS error when using `thread::Builder::new().spawn(…)`

https://doc.rust-lang.org/stable/std/thread/struct.Builder.html#method.spawn

`thread::spawn` is just a convenient function which panics on such an error

https://doc.rust-lang.org/stable/std/thread/fn.spawn.html

If you are pedantic, you could add `std::thread::spawn` and `std::thread::Scope::spawn` to the `disallowed_methods` in your Clippy config file clippy.toml:

https://doc.rust-lang.org/stable/clippy/configuration.html
Author Public Key
npub1j7fc87rk03whjh72mphc9hrm8zecfsdywdcscsesznwzcrasudvs75mapy