add enum containing all successful route returns #614

Слито
igalic слито 10 коммит(ов) из refactor/route-result в master 2019-06-14 07:33:31 +00:00
igalic оставлен комментарий 2019-06-08 08:36:25 +00:00 (Перенесено из github.com)

This enum derives Responder, so it can be used as route result.
We also implement From, so it can be converted

This pr addresses #613

This enum derives `Responder`, so it can be used as route result. We also implement `From`, so it can be converted This pr addresses #613
codecov[bot] оставлен комментарий 2019-06-08 15:00:19 +00:00 (Перенесено из github.com)

Codecov Report

Merging #614 into master will not change coverage.
The diff coverage is 0%.

@@           Coverage Diff           @@
##           master     #614   +/-   ##
=======================================
  Coverage   35.31%   35.31%           
=======================================
  Files          68       68           
  Lines        7907     7907           
  Branches     1893     1893           
=======================================
  Hits         2792     2792           
  Misses       4345     4345           
  Partials      770      770
# [Codecov](https://codecov.io/gh/Plume-org/Plume/pull/614?src=pr&el=h1) Report > Merging [#614](https://codecov.io/gh/Plume-org/Plume/pull/614?src=pr&el=desc) into [master](https://codecov.io/gh/Plume-org/Plume/commit/4b205fa995a6935a2512a9725d84635e889db48e?src=pr&el=desc) will **not change** coverage. > The diff coverage is `0%`. ```diff @@ Coverage Diff @@ ## master #614 +/- ## ======================================= Coverage 35.31% 35.31% ======================================= Files 68 68 Lines 7907 7907 Branches 1893 1893 ======================================= Hits 2792 2792 Misses 4345 4345 Partials 770 770 ```
igalic оставлен комментарий 2019-06-09 20:34:32 +00:00 (Перенесено из github.com)

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

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
rfwatson (Перенесено из github.com) оставлена рецензия 2019-06-11 11:55:49 +00:00
rfwatson (Перенесено из github.com) оставлен комментарий 2019-06-11 11:09:13 +00:00

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.

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.
trinity-1686a оставлена рецензия 2019-06-13 20:54:03 +00:00
trinity-1686a оставил комментарий
Владелец

👍

:+1:
trinity-1686a оставлен комментарий 2019-06-13 20:50:16 +00:00
Владелец

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)

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](https://api.rocket.rs/v0.4/rocket/http/uri/struct.Origin.html) 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)
igalic (Перенесено из github.com) оставлена рецензия 2019-06-13 21:43:30 +00:00
igalic (Перенесено из github.com) оставлен комментарий 2019-06-13 21:43:30 +00:00

do you have a suggestion for improvement?

do you have a suggestion for improvement?
trinity-1686a оставлена рецензия 2019-06-14 06:03:16 +00:00
trinity-1686a оставлен комментарий 2019-06-14 06:03:16 +00:00
Владелец

I do but I don't know how to explain it with words, so I'll probably do it myself during the week end

I do but I don't know how to explain it with words, so I'll probably do it myself during the week end
trinity-1686a изменения одобрены 2019-06-14 06:03:27 +00:00
igalic (Перенесено из github.com) оставлена рецензия 2019-06-14 07:32:46 +00:00
igalic (Перенесено из github.com) оставлен комментарий 2019-06-14 07:32:46 +00:00

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.

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.
Войдите, чтобы присоединиться к обсуждению.
Нет рецензентов
Нет этапа
Нет проекта
Нет назначенных
2 участников
Уведомления
Срок выполнения
Срок выполнения недействителен или находится за пределами допустимого диапазона. Пожалуйста, используйте формат «гггг-мм-дд».

Срок выполнения не установлен.

Зависимости

Зависимостей нет.

Ссылка: Plume/Plume#614
Описание отсутствует.