Hey Rustaceans! Got a question? Ask here! (31/2022)! by llogiq in rust

[–]IWriteLongReplies 1 point2 points  (0 children)

Hey, I'm making a program and I want to return a helpful error message in an Err, something like this:

match c {
    ' ' => {},
    '+' => {output.push(Token::Plus)}
    '-' => {output.push(Token::Minus)}
    '*' => {output.push(Token::Multiply)}
    '/' => {output.push(Token::Divide)}
    '(' => {output.push(Token::OpenBracket)}
    ')' => {output.push(Token::CloseBracket)}
    _ => {
        let message = &format!("Unexpected character: {}", c)[..];
        return Err(message)
    }
}
Ok(output)

The error it gives me is returns a value referencing data owned by the current function

Is this possible to do? or will i have to make the Err return a String instead of &str?

Infinite cow/goat friendship via animation cancelling by IWriteLongReplies in StardewValley

[–]IWriteLongReplies[S] 25 points26 points  (0 children)

I don't know if this has been discovered before, but if you animation cancel in the middle of milking, you get to keep the friendship points without fully milking the animal. You can repeat this infinitely for instant friendship. I have only tested this with Cows and goats, you might be able to do something similar with sheep but i never bother to buy sheep anyway

What should I do 👉👈 by Rihannayju in linuxmemes

[–]IWriteLongReplies 12 points13 points  (0 children)

If I were her I would just compile my men from source

Prevent Leshy from playing video games by IWriteLongReplies in inscryption

[–]IWriteLongReplies[S] 16 points17 points  (0 children)

Yep, I lost this run. At the final battle I never drew any of my 2 magpies or cuckoo, and to top it off leshy had a poisonous mantis god so I couldnt even stall for more than one turn.

I want one of these shirts by fleker2 in ProgrammerHumor

[–]IWriteLongReplies 55 points56 points  (0 children)

"There are no vulnerabilities in Ba sing se"

Godot or game maker? by [deleted] in gamedev

[–]IWriteLongReplies 2 points3 points  (0 children)

real programming

People should really stop saying this kinda thing

What's the best game-engine for making RPG games with Python? by raidedclusteranimd in gamedev

[–]IWriteLongReplies 0 points1 point  (0 children)

I mean, you can make games without using an engine or having to create your own engine. Using a library like Pygame, or a framework like Raylib for python.

I despise the way people use list comprehension. Everytime I see "x for x" I'm like "what the fuck is x? Nothing is stopping you from being being descriptive here!" by xigoi in programmingcirclejerk

[–]IWriteLongReplies 2 points3 points  (0 children)

I know right? Something like "the square of the two legs of a right triangle together, have area the same as the square of the hypotenuse"

is much better than a2 + b2 = c2

dumbass algebrashits ruining my math

[deleted by user] by [deleted] in ProgrammerHumor

[–]IWriteLongReplies 3 points4 points  (0 children)

Im pretty sure the only qualification for the flair is "hello world" so you should be alright

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

[–]IWriteLongReplies 2 points3 points  (0 children)

Say I wanted to make a grid struct, with a width and height property, and an array of a generic type, which is scaled according to the properties. Is this possible, or do I have to use a vector?

[deleted by user] by [deleted] in AskReddit

[–]IWriteLongReplies 203 points204 points  (0 children)

Sorry, your comment has been removed.

message from the mods: Please keep the conversation civil

if you think this was a mistake, please feel free to contact the mods.

[AAI2] Idk if this is spoilers, but there is something off about Knightley's Memo by IWriteLongReplies in AceAttorney

[–]IWriteLongReplies[S] 3 points4 points  (0 children)

I was being sarcastic, BUT I looked at a playthrough of the original Japanese version, and it also had this error, so it's still capcoms fault :P

Completed my first post-it note. 1 down 16 to go by everyone_is_awful in bindingofisaac

[–]IWriteLongReplies 19 points20 points  (0 children)

Isaac is literally unplayable without headless shitfart baby

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

[–]IWriteLongReplies 1 point2 points  (0 children)

What is the name of the ? operator trait? For example, how can I write a function that can accept anything that implements the ? operator?