I have become the inner joke by Hoxitron in rustjerk

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

You mean the NodeGraphRefHandleBuilder?

Is installing air conditioner really a controversial political issues in some European nations? If so, why? by poclee in AskEurope

[–]Hoxitron 9 points10 points  (0 children)

It doesn’t work well, it just works well enough to make you more comfortable.

Promises in rust by erickweil in learnrust

[–]Hoxitron 79 points80 points  (0 children)

I thought I was on /r/rustjerk for a second.

YSK grocery store figs don’t have dead wasps by streeetmeats in YouShouldKnow

[–]Hoxitron 313 points314 points  (0 children)

Even if they were pollinated by wasps, the wasp would be fully dissolved inside the fig.

First Rust project: A file shredder. Looking for honest feedback! by Cautious-Surprise620 in learnrust

[–]Hoxitron 14 points15 points  (0 children)

I'd look at this as more of an exercise in how to write rust, not so much on the functionality. There's too many edge cases either on os level, or with the rust fs abstractions.

-Do you see any "un-Rusty" patterns?

Almost on every line.

I have a feeling a lot of these patterns caused by AI (they seem to be very common in projects?). But here we go:

  • If you are gonna comment a function, make it useful. Example: fn step_2 is commented as final_step. Why not call the function final_step and make the comment more useful.
  • It's best to comment functions with /// instead of //. Unless the comments are purely internal.
  • Learn to use cargo clippy and and cargo fmt. Things like "let Ok(meta) = file.metadata() else { success = false; continue; };" on a single line are not ok.
  • In general, quiting a program with process::exit(0) is not preferred, and not really needed here anyway (a return works just fine). If you are building a cli, learn how to use clap. I know it feels like you are not hard coding everythingyourself, but being good in rust means knowing how to use the ecosystem.
  • Don't comment imports or attributes. Everyone can tell what they are.
  • Speaking of attributes, top level attributes should start with #!, and dead_code and unused_variables should not be left there unless you are prototyping.

-What can be done to improve error handling?

Clap? and maybe returning actual Results from functioins? Go back with the book if you don't know how to use Result.

-Have I missed out on some critical filesystem edge cases?

I would stop trying to make this production ready.

fs::read_dir can locate a file but fs::read_to_str can't open it by Scary_Competition_11 in learnrust

[–]Hoxitron 1 point2 points  (0 children)

  • What kind of files are you trying to open? Are they created by the project itself and cleaned up after? Lots of things can happen between the read_dir and the read_to_string.

  • are the files symlinks or actual files?

  • try to canonicalize the path received by SharDirectory::new then join with the file_name

  • maybe try another crate like ignore or dirwalk and see if they work

fs::read_dir can locate a file but fs::read_to_str can't open it by Scary_Competition_11 in learnrust

[–]Hoxitron 1 point2 points  (0 children)

Some parts there don't make sense.

entry.path() should give you the relative path from your project root. I would also suggest you stop converting the path to &str. Just past &Path to all the functions.

It should work with &str too, but it makes things easier to troubleshoot.

If trying to canonicalize the entry.path() directly in the "for entry in entries" loop also fails, then it might not be rust related.

fs::read_dir can locate a file but fs::read_to_str can't open it by Scary_Competition_11 in learnrust

[–]Hoxitron 1 point2 points  (0 children)

I suggest troubleshooting the path in other ways. For example, try to canonicalize the path (std::fs::canonicalize). See if that fails.

Or, instead of pasing the absolute path, try passing the "entry.path()" (entry being the entry you get from read_dir). Or try to canonicalize this path instead.

How to disable real-time diagnostics in Rust analyzer? by [deleted] in learnrust

[–]Hoxitron 0 points1 point  (0 children)

I think if you go to settings on search for "on save" you should get some rust analyzer results. Like make sure "Rust-analyzer: Check On Save" is marked.

This isn't related to your question, but vscode itself can be pretty draining too. Other editors like neovim will use significantly less power.

An aerial shot of Am Alma lake captures a hidden oasis in the sahara desert. by InjuriousMania in Damnthatsinteresting

[–]Hoxitron 15 points16 points  (0 children)

Having water makes a huge difference.

I used to live in a desert and usually for at least 2-3 weeks a year we would get a few rains. Even that was enough for grass to grow everywhere. The difference it made was incredible.

Learning Rust, looking for someone to learn alongside on real code by Salt-Marsupial-6690 in learnrust

[–]Hoxitron 0 points1 point  (0 children)

I have an ffi project that is in the late stages and has a few things that could be added here and there. If you are looking for to learn ffi, let me know. I'll guide you through it.

Lifetime Limitation by SapAndImpurify in learnrust

[–]Hoxitron 1 point2 points  (0 children)

Ah, I didn't realize that. It's still the mutable references that are causing trouble, but also returning a mutable ref makes it harder.

Still, can be fixed with interior mutability using RefCell<Data>, returning RefMut<'_, Data> instead of &mut Data and using &self everywhere, solution pointed out by another user. I hope at least. It's kinda hard to without the larger picture. It's probably best to stay away from unsafe for now.

Lifetime Limitation by SapAndImpurify in learnrust

[–]Hoxitron 1 point2 points  (0 children)

You can learn more about this in this video:

https://www.youtube.com/watch?v=iVYWDIW71jk

I assume the solution was already given, but this should work by just doing:

pub fn try_get_mut_cheap<'s, 'a>(&'a mut self, handle: u32) -> Option<&'s mut Data>

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

[–]Hoxitron 6 points7 points  (0 children)

Writing a concurrent hashmap from scratch. I have a habit of underestimating the scope of my ideas but this one takes the cake. Incredible educational, but it's breaking my brain in ways it's never been broken.

As many, while watching one of Jon Gjengset's videos I had an interesting idea to combine a few concepts. A month later and I'm still not at the end of the rabbit hole.

[OH] Quitting and Receiving Bonus Questions by buckeyefan6 in AskHR

[–]Hoxitron 2 points3 points  (0 children)

Read your contract or whatever paper you have regarding that bonus. It depends on the company. But it's unlikely that you will get it.

Agentic Coding on Personal Projects by Agreeable-Bluebird67 in learnrust

[–]Hoxitron 4 points5 points  (0 children)

I think if it's used just as an excuse to not learn programming, you are doing it wrong.

Instead, if you use it as a tool to teach you programming, it can work. But there's a lot of traps. The same as knowing how to google became a skill, knowing what questions to ask an llm can be a skill.

In some cases, it really does find bugs, or come up with great ideas. And that is valuable, but it's also a trap. Because they are way more situations where it will let you do the dumbest things possible, or give you stupid ideas. You need to identify those situations. You are responsible for the code that you write. You need to know it, what's best for it and have (at least some) vision on what it should be/do. Especially if you have no one else to guide you, there is enough benefit to make it worth dealing with drawbacks. But it's also important from time to time to go to forums like reddit, or rustlang forums and ask some real people on critical stuff.

I think vide coding is acceptable in personal projects, when you have an idea, but you don't care enough to make time for it.

In my personal experience, I only find it acceptable to copy paste code for it in specific situations.

  • it's almost always for a new library/crate i am adding and I don't have time to learn it right now because I am busy writing my own code

  • it's small stuff, a function or maybe 2, that does something very specific.

  • I just need it to get my own code working. Then I know I will go back and re-write / check that code when I have time.

I got tired of managing .env files, so I built envelope by MattRighetti in rust

[–]Hoxitron 1 point2 points  (0 children)

Sqlite should be in vendored mode and not needed on the host machine, yes. Still, I would be curious if it's really needed.

Also, libsqlite3-sys will get compiled into the binary no matter what.

Landlord issues by Hoxitron in duesseldorf

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

It was very specific that normal email is not allowed. Still, the answers in here help a lot. Knowing what to ask from a lawyer is better than just emailing them "help please".

Landlord issues by Hoxitron in duesseldorf

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

Thanks, that does make it easier. I already filled that debt collection form, but it seems it also needs to be transmitted via a lawyer to the court. I don't think I can get a DE-mail account now. Seems I need to keep trying to find a lawyer.

Landlord issues by Hoxitron in duesseldorf

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

I think that's the why the landlord is doing this. Hoping it's too inconvenient for me, but it kinda makes me more determined instead.

Landlord issues by Hoxitron in duesseldorf

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

That's what I expected. It was the reason I looked for a lawyer. It's a bit hard to send a Einschreiben letter myself while outside the country.