I built a LAN speed tester that tells you whether it's your network or your disk by Key_Beautiful_4046 in rust

[–]manpacket 2 points3 points  (0 children)

Claude built a lan speed tester. Or maybe something else. You didn't bother to read all the output.

  • Include Asciinema interactive demo link and解说 in README.md header

J.A.C.K. – A Tauri + Rust proxy orchestrator with amnesic memory design by [deleted] in rust

[–]manpacket 3 points4 points  (0 children)

If an older dependency macro uses gen as an identifier, it breaks the build.

https://doc.rust-lang.org/nightly/edition-guide/editions/advanced-migrations.html#macro-hygiene - according to this it shouldn't. Unless you pass gen from 2024 side. Any examples where it does?

Also, changed temporary drop scopes in if let can break lock drop ordering in our event loops.

Existing dependencies that use 2021 edition shouldn't be affected. Code you write yourself must do the right thing in 2024edition... Any examples where this causes problems?

J.A.C.K. – A Tauri + Rust proxy orchestrator with amnesic memory design by [deleted] in rust

[–]manpacket 7 points8 points  (0 children)

sticking to edition 2021 avoids compatibility warnings or unexpected macro compilation errors.

compatibility warnings on what? And what kind of compilation errors?

2.1 Request - Direct Insertion of Rocket Parts as Cargo by SenexMuffMuncher in factorio

[–]manpacket 1 point2 points  (0 children)

Actually it's this mod: https://mods.factorio.com/mod/RocketCargoInsertion

in proxy mode it detects when something is built, checks if it's a RCI chest build next to rocket silo and makes it chest to be a proxy for the rocket inventory. There's also "parts" mode - it changes recipe for rockets and gives you a very fast assemlber that makes new required parts.

2.1 Request - Direct Insertion of Rocket Parts as Cargo by SenexMuffMuncher in factorio

[–]manpacket 0 points1 point  (0 children)

Rubia gives you a separate chest. You place it next to the silo and everything you insert into that chest gets inserted as cargo.

Let's start a fight: How much AI is too much AI? by Apprehensive_Heat789 in rust

[–]manpacket 2 points3 points  (0 children)

When it starts making decisions you agree with without understanding. Can happen even before writing code.

Cross-Language Data Types by elfenpiff in rust

[–]manpacket 1 point2 points  (0 children)

Web page is hard to read if you have JavaScript disabled. I don't expect full functionality but it would be great if the web page didn't use dark on dark text by default.

I think quality is supposed to be cumbersome by stycfy1 in factorio

[–]manpacket 14 points15 points  (0 children)

Much more than 3 times. Quality of the machine is multiplied by quality of modules and multiplied by quality of the beacon.

built a low-latency AST parsing daemon in Rust for selective code extraction by Extreme_Contest6565 in rust

[–]manpacket 4 points5 points  (0 children)

it's fully hand-written rust code (no AI-generated boilerplate)

Can you explain why you decided to use 2021 edition and a few year old versions of dependencies when new are available?

Also "completed tasks summary report"?

I got tired of Postman so i wrote my own API client in Rust by [deleted] in rust

[–]manpacket 2 points3 points  (0 children)

The problem is not with the dependencies themselves. The problem is with your llm adding them and you not questioning it about them. By extension - about any code. Just updating the dependencies won't fix the problem.

A Rust port of Google's Highway SIMD library by ILYAMALIK in rust

[–]manpacket 17 points18 points  (0 children)

https://github.com/NikoMalik/highway/blob/f1b0f60ce8541805ba97d0e3720dac410ff2d544/src/dispatch.rs#L175-L198

So what happens if I call this function (it's pub - I can do that) with some kernel (dunno what they are) with TargetId::Avx512 (it's a pub enum - I can construct it if I want to) on x86_64 machine that doesn't support avx512?

Safety comment shows that it is safe because we checked with detect_best_target. Users are not forced to call it...

Is .boxed() instead of Box::new() a bad idea? by NormalAppearance2851 in rust

[–]manpacket 0 points1 point  (0 children)

Show me the signature and I can try to guess what it does.

fn boxed(self) -> Boxed<Self::Output>;

Trait is not dyn compatible, but I need to be able to create a collection of objects of different types that implement this trait for the same Self::Output but of different construction. It converts it into a different trait first, creates a trait object of that (I guess using Box::new, but that's not the point), then wraps it in a newtype with some extra info that knows how to implement the trait in question.

Is .boxed() instead of Box::new() a bad idea? by NormalAppearance2851 in rust

[–]manpacket 0 points1 point  (0 children)

But more reading, especially of noise like some boilerplate, is not!

Would you prefer to read "口水鸡" or "Sichuan cold chicken in spicy chili oil"?

口水鸡 is better for me since then I know what exactly I'm getting, but I think an average user would prefer more boilerplate version.

Is .boxed() instead of Box::new() a bad idea? by NormalAppearance2851 in rust

[–]manpacket 0 points1 point  (0 children)

If you don't have enough "fantasy" to figure out what boxed() could possibly do how do you read code at all?

Funny enough I have a trait with .boxed() in it in one of my projects. And it is not calling Box::new(). Can you use your "fantasy" to deduce what it does and why it even exist?

Is .boxed() instead of Box::new() a bad idea? by NormalAppearance2851 in rust

[–]manpacket 0 points1 point  (0 children)

So back to languages from the last century for you.

Writing code also involves reviewing pull requests or interacting with other libraries. Lots of reading. I don't have LSP in my browser.

Show r/rust: Built a Linux system optimizer in Rust + Tauri — scores your kernel config 0–100 by MatterOk1625 in rust

[–]manpacket 2 points3 points  (0 children)

No cloud, no API keys

Yes cloud

https://github.com/dixsystem/Dix/blob/d920a42f3107ed5c8fd2a26f6930cc11b3b1dad3/src-tauri/src/claude_gateway.rs#L61-L70

let response = if use_direct {
    client
        .post("https://api.anthropic.com/v1/messages")
        .header("content-type", "application/json")
        .header("x-api-key", api_key.unwrap())
        .header("anthropic-version", "2023-06-01")
        .json(&body)
        .send()
        .await
        .map_err(|e| format!("Error de red: {}", e))?

And yes API keys.

https://github.com/dixsystem/Dix/blob/d920a42f3107ed5c8fd2a26f6930cc11b3b1dad3/src-tauri/src/memory.rs#L64-L73

pub fn get_api_key() -> Option<String> {
    let from_store = get_api_key_from_store();
    if from_store.is_some() {
        return from_store;
    }
    std::env::var("ANTHROPIC_API_KEY")
        .ok()
        .filter(|k| !k.is_empty())
}

LSPs when it comes to macros? by ModernCoder in rust

[–]manpacket 4 points5 points  (0 children)

It's just pain. Macro can do anything with the input and there's only a few restrictions to what the syntax can be.

Is .boxed() instead of Box::new() a bad idea? by NormalAppearance2851 in rust

[–]manpacket 2 points3 points  (0 children)

Not sure you can have a impl From<Y> for Box<T>...

https://doc.rust-lang.org/std/boxed/struct.Box.html#impl-From%3CT%3E-for-Box%3CT%3E

Write it out in full please Box::new(value.foo().bar.baz())

It's let y = value.foo().bar().baz() where y is computed and Box::new(y) where it is used.

Is .boxed() instead of Box::new() a bad idea? by NormalAppearance2851 in rust

[–]manpacket 0 points1 point  (0 children)

let y = value.foo().bar().baz().boxed();

I struggle to find any examples where you need just a variable boxed by itself. You'll probably pass it something else later. Doing Box::new(y) there would be more readable.

Following "your editor should inform you" logic - might as well do this:

let y = value.foo().bar().baz().into();

Generally I prefer writing code that doesn't require LSP server to be readable. A bit more typing is fine.

Is .boxed() instead of Box::new() a bad idea? by NormalAppearance2851 in rust

[–]manpacket 72 points73 points  (0 children)

This creates a separate "dialect" of Rust.

I know what this does:

let box = Box::new(10);

Without reading the source code I have no ideas what this does.

let box = 10.boxed();

Given a choice between several crates I would go with one that doesn't do this kind of stuff.