• 0 Posts
  • 90 Comments
Joined 1 year ago
cake
Cake day: December 31st, 2023

help-circle
  • To explain

    There are 2 Error struct / enum declarations, probably in separate files

    To the ?, they are different types and cannot be converted from one to the other (because they are two disparate structs that happen to have the same name, but can have different bodies)

    To fix this

    You can either use .some_func_result().map_err(|err| /* conversion here/*)?; +

    Or you can impl From<Error1> for Error2

    And you should also name it ThingError, so you can visually differentiate the two


    + There are like 10 different mapping functions, depending on if you’re using an option or a result

    I never remember which one specifically i need, (unwrap_or, map_or, map_or_else, ok, ok_or)

    I usually just hunt through the auto complete list until i find the function signature that gives me what i need














  • Lightfire228@pawb.socialtoProgrammer Humor@lemmy.mlCommit
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    4 months ago

    I mean, you just need to look at the conflicting files, fix up the code, then stage those changes and pop a new commit

    There’s no “special” merge conflict resolution commit “type”


    As for fixing the code itself, I usually look at what changed between both versions, and then re-author the code such that both changes make “sense”



  • I’ve started collecting ideas in my notes

    I open Obsidian, create a new note, and jot down the idea

    Obsidian is preconfigured to add new notes to an Inbox folder, and the note’s name defaults to the date and time

    At a later time, I go through my inbox and rename and recategorize


    This makes writing down ideas painless, while also minimizing the interruption of whatever I was doing at the time


  • Speaking as the “never wore winter clothes” kid, when you’re overweight, you can tolerate colder weather due to body fat being a natural insulator

    Combine that with a natural tolerance for cold, and sensory issues with heavy clothes, and you get this.

    To the point where I had many fights with my parents over it

    (I still wear sandals year round because fuck shoes)



  • I’m more talking about theory than practical.

    I’ve not developed anything in C/C++, so I don’t know practical uses for a double pointer, aside from multidimensional arrays, or arrays of pointers

    My point was that, conceptually, pointers to pointers is how most complex data structures work. Even if the C representation of said code doesn’t have a int** somewhere