add enum containing all successful route returns #614
Nessun revisore
Etichette
Nessuna etichetta
A: API
A: Backend
A: Federation
A: Front-End
A: I18N
A: Meta
A: Security
Build
C: Bug
C: Discussion
C: Enhancement
C: Feature
Compatibility
Dependency
Design
Documentation
Good first issue
Help welcome
Mobile
Rendering
S: Blocked
S: Duplicate
S: Incomplete
S: Instance specific
S: Invalid
S: Needs Voting/Discussion
S: Ready for review
Suggestion
S: Voted on Loomio
S: Wontfix
Nessuna pietra miliare
Nessun progetto
Nessun assegnatario
2 partecipanti
Notifiche
Scadenza
Nessuna scadenza impostata.
Dipendenze
Nessuna dipendenza impostata.
Riferimento: Plume/Plume#614
Caricamento…
Add table
Crea riferimento in una nuova segnalazione
Descrizione non fornita.
Elimina ramo "refactor/route-result"
L'eliminazione di un ramo è definitiva. Nonostante il ramo eliminato potrebbe continuare ad esistere per un breve periodo di tempo prima di essere realmente eliminato, l'eliminazione NON PUÒ essere annullata in molti casi. Continuare?
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.