add enum containing all successful route returns
#614
Fusionnée
igalic
a fusionné 10 révision(s) à partir de refactor/route-result
vers master
il y a 5 ans
Chargement…
Référencer dans un nouveau ticket
Il n'existe pas encore de contenu.
Supprimer la branche 'refactor/route-result'
Supprimer une branche est permanent. Cela NE PEUVENT être annulées. Continuer ?
This enum derives
Responder
, so it can be used as route result.We also implement
From
, so it can be convertedThis pr addresses #613
Codecov Report
I've marked this pull request now ready for review.
even though there's at least one function left that could be improved (in readability, or at least refractored to use this enum)
but i don't think we can make further strides without improving our ErrorPage
So if I read this correctly, the Rust compiler infers the type from the return type of the function, allowing
into()
to function as expected?Even though I should probably expect that from Rust, that's still pretty neat.
👍
Isn't it a bit strange that when redirecting to invalid uri, it gives an error? It would probably make more sens that the chain on line 100 does the parsing to, and default to
parse("/").unwrap()
. Also it should probably be a Origin to block redirection to other domain(this is also true for previous code, it's pretty old, I'm pretty sure we did not do code review last September)
do you have a suggestion for improvement?
I do but I don't know how to explain it with words, so I'll probably do it myself during the week end
well, I'll be happy to review it then, and help with words where necessary
i used to be quite good with words, now i'm procrastinating on writing words, by working on a blogging platform.
Relecteurs
3d27e283ad
.Étape 1:
Depuis le dépôt de votre projet, sélectionnez une nouvelle branche et testez les modifications.Étape 2:
Fusionner les modifications et mettre à jour sur Forgejo.