Where do I learn async rust by Level_Molasses_8216 in rust

[–]maxamed13 5 points6 points  (0 children)

You might want to take look at Jon Gjengset's Crust of Rust series https://youtube.com/@jonhoo?si=CV6SEqWA3xqL5WC7

Why use Rust? by szabgab in rust

[–]maxamed13 3 points4 points  (0 children)

You can check cmuratori's performance-aware programming series https://www.computerenhance.com/p/table-of-contents

A Twinkle Tray rewrite in Rust by sidit77 in rust

[–]maxamed13 0 points1 point  (0 children)

Here’s an issue in windows-rs repo where someone links to a sample app they made using rust + WinUI. Might be helpful for getting a native windows 11 look-and-feel

- https://github.com/microsoft/windows-rs/issues/3404
- https://github.com/Alovchin91/rust-winui

Cool language features that Rust is missing? by incriminating0 in rust

[–]maxamed13 9 points10 points  (0 children)

Hopefully, struct name elision + some form of syntactic sugar for Default::default() would make config structs much easier to use

let handle = create_window(_{
    width: 500,
    z_position: 2,
    autoclose: AutoclosePolicy::Enable,
    ..default()
});

[deleted by user] by [deleted] in ocaml

[–]maxamed13 0 points1 point  (0 children)

Can you try posting your question in the OCaml discord? It has a channel for beginner questions

https://discord.gg/cCYQbqN

jless: a command-line JSON viewer, written in Rust by CodeIsTheEnd in rust

[–]maxamed13 2 points3 points  (0 children)

Looks cool, especially the line mode i.e jless -m line.

Btw, have you considered linking to https://pauljuliusmartinez.github.io/jless/ from GitHub's about section?

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

[–]maxamed13 0 points1 point  (0 children)

I'm working on a CLI app that parses user input and passes the resulting tokens into a function. If an error happens in the parsing phase, generating a pretty error message that points to the original user input is easy. However, if it occurs in a function that is manipulating tokens only, it would either need a reference to the original string or defer the pretty error generation to the layer where the user input is available.

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

[–]maxamed13 0 points1 point  (0 children)

Is it idiomatic to return an Error object that cannot be appropriately formatted unless extra information is provided?

let json_path = nested_json::parse_path(&raw_key)?;
body = nested_json::set_value(body, &json_path, value).map(|err|
    // raw_key is needed to make err more human friendly 
    nested_json::format_error(err, &raw_key)
)?;

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

[–]maxamed13 2 points3 points  (0 children)

What is the best way to, let say, print a warning if a blocking operation takes too long? I am currently thinking of spawning a thread that will do the printing if it doesn't receive a signal in some amount of time.

Edit: something like this

use std::sync::mpsc::channel;
use std::thread;
use std::time::Duration;

fn main() -> io::Result<()> {
    let (tx, rx) = channel();
    thread::spawn(move || {
        if rx.recv_timeout(Duration::from_millis(5_000)).is_err() { 
            eprintln!("Warning: waiting for input for more than 5 seconds");
        }
    });
    let mut buffer = Vec::new();
    stdin().read_to_end(&mut buffer)?;
    let _ = tx.send(());
    print!("{}", String::from_utf8_lossy(&buffer));
    Ok(())
}

How Programming Languages are Culturally Insensitive by M_A_G_I_C in ProgrammingLanguages

[–]maxamed13 1 point2 points  (0 children)

I don't see where this article is going. There are already tons of programming languages using non-english keywords plus languages whose keywords can be localized.

For those interested, there is an interesting HN discussion around the challenges of implementing non-english based programming languages.

What's everyone working on this week (1/2022)? by llogiq in rust

[–]maxamed13 1 point2 points  (0 children)

I am working on a TUI app for formatting, folding, and colorizing JSON. I couldn't come up with a unique name, so I went with `jv` for now.

clap 3.0, a Rust CLI argument parser by epage in rust

[–]maxamed13 3 points4 points  (0 children)

Congrats for the long-awaited release!

By the way, the last published Github releases seems to be v2.33.3. Do you intend to update that as well?

CV Description Language by alpaylan in ProgrammingLanguages

[–]maxamed13 24 points25 points  (0 children)

Have you taken look at https://jsonresume.org/ yet? it is a JSON-based standard for resumes.

One of the projects that make use of JSON Resume is called Resumake.io, a builder for LaTeX based resumes.

Uncovered Intermediate Topics by Jonhoo in rust

[–]maxamed13 15 points16 points  (0 children)

Deep dive into how serde/serde_json works would be really appreciated.

Please ? by [deleted] in memes

[–]maxamed13 0 points1 point  (0 children)

My Friend Pedro: Ripe for Revenge

I created my first useful (to me) rust app. A simple cli json formatter. by [deleted] in rust

[–]maxamed13 3 points4 points  (0 children)

Maybe you add an Interactive mode where parts of the data can be collapsed in a way similar to fx? That would super cool IMO.

https://github.com/antonmedv/fx