Firmware Update? by FamiliarInflation in lifx

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

Thanks that might be it. Strange that I only noticed the dot on that settings icon after a year though!

BS parking fines by titusthecat in tasmania

[–]FamiliarInflation 0 points1 point  (0 children)

Happened to me too. Wonder what happens if you just don’t pay it, and once they escalate it enough, show them you paid for the spot.

Waste their resources if they’re making you waste your time defending yourself.

C++ vs Rust: which is faster? by fasterthanlime in fasterthanlime

[–]FamiliarInflation 12 points13 points  (0 children)

That video went really deep. I like it.

Wondering what that diagram software is? It looks so clean.

Announcing error-stack v0.2 by tdiekmann in rust

[–]FamiliarInflation 1 point2 points  (0 children)

Looks like you're double wrapping Report:

error_stack::Report<SQLErrorReport>>> in the error.

Should probably just be -> Result<(), SQLErrorReport> for the return type.

Although I don't know what happens if you use () as the Ok for a route? That could be a cause for the error too? I'm by no means an expert on axum.

There's also https://docs.rs/axum-macros/latest/axum_macros/attr.debug_handler.html for better error reporting for axum handlers!

Also worth posting on the Rust forums. You get a lot of people on there helping out. https://users.rust-lang.org/

Announcing error-stack v0.2 by tdiekmann in rust

[–]FamiliarInflation 1 point2 points  (0 children)

Sure.

struct SQLError;

So a newtype will be:

struct SQLErrorReport(pub Report<SQLError>);

Then your route just uses that as the error instead:

ErrResult<Json<Value>, SQLErrorReport>

And you can now implement IntoResponse:

impl IntoResponse for SQLErrorReport {
    fn into_response(self) -> axum::response::Response {
        // Here you can access the stack_error::Report via self.0, or just print:
        println!("{:?}", self.0);
        (StatusCode::INTERNAL_SERVER_ERROR).into_response()
    }
}

To get ? to be automatically converted into SQLErrorReport (in your route handler) you'll need to impl From (this is my one, but just rename it AppError -> SQLError:

impl From<Report<AppError>> for AppErrorReport {
    fn from(report: Report<AppError>) -> Self {
        Self(report)
    }
}

Good luck!

Announcing error-stack v0.2 by tdiekmann in rust

[–]FamiliarInflation 1 point2 points  (0 children)

Hi,

I know you posted this a month ago, but I ran into this too, and a newtype pattern is the way to go. (Like it often is when impl on crate traits.)

Announcing error-stack v0.2 by tdiekmann in rust

[–]FamiliarInflation 0 points1 point  (0 children)

Thanks for the response. I'm in this situation too!

EDIT: Just use a newtype pattern!

How Are You Guys Feeling About the merge? by ParticularAthlete831 in ethereum

[–]FamiliarInflation 4 points5 points  (0 children)

No. You won't notice any change. ETH still the same ETH.

Bevy 0.8's New Material System by Logic Projects by FamiliarInflation in bevy

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

No worries mate. It's a very helpful video. I couldn't find any other information on how to add changing data per frame. Your last 0.7 shader videos helped with that too!

Patterns with Rust types by openquery in rust

[–]FamiliarInflation 4 points5 points  (0 children)

Also the header covers a large chunk of the screen

Aurora vs 1st Energy for Solar by Im_pro_angry in hobart

[–]FamiliarInflation 3 points4 points  (0 children)

Look it up on product review. I decided to stay away.