• 0 Posts
  • 22 Comments
Joined 3 years 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.ml•Commit
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    2 years 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”




  • As a software dev, i like having 3. Gives me space to see

    • console output and debug info on the left
    • my code editor in the center
    • and my browser on the right

    Or having multiple vscode windows and a browser

    I also move windows around using the keyboard (win + left / right), and the task switcher (alt + tab)