5
1
Derivar 0

Feature: async trait #11

Integrado
igalic integrou 8 cometimento(s) do ramo plume/webfinger:feat/async-trait no ramo main há 4 anos
igalic comentou há 4 anos (Migrado de github.com)

add a feature (behind a off-by-default flag) to use async trait implementations.

add a feature (behind a off-by-default flag) to use async trait implementations.
igalic comentou há 4 anos (Migrado de github.com)

for now, this doesn't work, because impl String is not (necessarily) Send safe.

for now, this doesn't work, because `impl String` is not (necessarily) `Send` safe.
igalic comentou há 4 anos (Migrado de github.com)

current status:

meena@76ix ~/s/a/webfinger (feat/async-trait)> cargo +nightly build --features async
   Compiling webfinger v0.5.0 (/home/meena/src/ap/webfinger)
error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position
 --> src/async_trait.rs:8:1
  |
8 | #[async_trait]
  | ^^^^^^^^^^^^^^ explicit generic argument not allowed
  |
  = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

error: could not compile `webfinger`.

To learn more, run the command again with --verbose.
meena@76ix ~/s/a/webfinger (feat/async-trait) [101]> 
current status: ``` meena@76ix ~/s/a/webfinger (feat/async-trait)> cargo +nightly build --features async Compiling webfinger v0.5.0 (/home/meena/src/ap/webfinger) error[E0632]: cannot provide explicit generic arguments when `impl Trait` is used in argument position --> src/async_trait.rs:8:1 | 8 | #[async_trait] | ^^^^^^^^^^^^^^ explicit generic argument not allowed | = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to previous error error: could not compile `webfinger`. To learn more, run the command again with --verbose. meena@76ix ~/s/a/webfinger (feat/async-trait) [101]> ```
codecov[bot] comentou há 4 anos (Migrado de github.com)

Codecov Report

Merging #11 into main will increase coverage by 2.68%.
The diff coverage is 96.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #11      +/-   ##
==========================================
+ Coverage   91.39%   94.07%   +2.68%     
==========================================
  Files           2        4       +2     
  Lines         151      287     +136     
==========================================
+ Hits          138      270     +132     
- Misses         13       17       +4     
Impacted Files Coverage Δ
src/lib.rs 86.45% <81.25%> (-1.43%) ⬇️
src/tests.rs 97.54% <98.50%> (+3.42%) ⬆️
src/async_resolver.rs 100.00% <100.00%> (ø)
src/resolver.rs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c494677...e2b2b37. Read the comment docs.

# [Codecov](https://codecov.io/gh/Plume-org/webfinger/pull/11?src=pr&el=h1) Report > Merging [#11](https://codecov.io/gh/Plume-org/webfinger/pull/11?src=pr&el=desc) into [main](https://codecov.io/gh/Plume-org/webfinger/commit/9f1e0e7074d466cf62a618a5c2bb785e50c0c27c&el=desc) will **increase** coverage by `2.68%`. > The diff coverage is `96.39%`. [![Impacted file tree graph](https://codecov.io/gh/Plume-org/webfinger/pull/11/graphs/tree.svg?width=650&height=150&src=pr&token=9gTr9Sg00C)](https://codecov.io/gh/Plume-org/webfinger/pull/11?src=pr&el=tree) ```diff @@ Coverage Diff @@ ## main #11 +/- ## ========================================== + Coverage 91.39% 94.07% +2.68% ========================================== Files 2 4 +2 Lines 151 287 +136 ========================================== + Hits 138 270 +132 - Misses 13 17 +4 ``` | [Impacted Files](https://codecov.io/gh/Plume-org/webfinger/pull/11?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [src/lib.rs](https://codecov.io/gh/Plume-org/webfinger/pull/11/diff?src=pr&el=tree#diff-c3JjL2xpYi5ycw==) | `86.45% <81.25%> (-1.43%)` | :arrow_down: | | [src/tests.rs](https://codecov.io/gh/Plume-org/webfinger/pull/11/diff?src=pr&el=tree#diff-c3JjL3Rlc3RzLnJz) | `97.54% <98.50%> (+3.42%)` | :arrow_up: | | [src/async\_resolver.rs](https://codecov.io/gh/Plume-org/webfinger/pull/11/diff?src=pr&el=tree#diff-c3JjL2FzeW5jX3Jlc29sdmVyLnJz) | `100.00% <100.00%> (ø)` | | | [src/resolver.rs](https://codecov.io/gh/Plume-org/webfinger/pull/11/diff?src=pr&el=tree#diff-c3JjL3Jlc29sdmVyLnJz) | `100.00% <100.00%> (ø)` | | ------ [Continue to review full report at Codecov](https://codecov.io/gh/Plume-org/webfinger/pull/11?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/Plume-org/webfinger/pull/11?src=pr&el=footer). Last update [c494677...e2b2b37](https://codecov.io/gh/Plume-org/webfinger/pull/11?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
igalic comentou há 4 anos (Migrado de github.com)

back to building, now we need to add a test for async.

This: https://gist.github.com/a5727727c2f55be6f37e937bfc232d32 is not it: https://gist.github.com/ae41ec328a2a443fa02214a4b0f19281

back to building, now we need to add a test for async. This: https://gist.github.com/a5727727c2f55be6f37e937bfc232d32 is not it: https://gist.github.com/ae41ec328a2a443fa02214a4b0f19281
trinity-1686a aprovou estas modificações há 4 anos
trinity-1686a deixou um comentário
Proprietário(a)

LGTM

I feel like test_my_resolver/test_my_async_resolver are more coverage oriented than correctness : the valid answer is barely validated, however this is unrelated to this pr

LGTM I feel like test_my_resolver/test_my_async_resolver are more coverage oriented than correctness : the valid answer is barely validated, however this is unrelated to this pr
@ -0,0 +9,4 @@
pub trait AsyncResolver {
type Repo: Send;
/// Returns the domain name of the current instance.
async fn instance_domain<'a>(&self) -> &'a str;
Proprietário(a)

I'm not sure this requires to be async, I would expect an implementation to return one of its fields, but I guess there is nothing wrong with too much async, it'll just get optimized away during monomorphisation

I'm not sure this requires to be async, I would expect an implementation to return one of its fields, but I guess there is nothing wrong with too much async, it'll just get optimized away during monomorphisation
igalic (Migrado de github.com) reviu há 4 anos
@ -0,0 +9,4 @@
pub trait AsyncResolver {
type Repo: Send;
/// Returns the domain name of the current instance.
async fn instance_domain<'a>(&self) -> &'a str;
igalic (Migrado de github.com) comentou há 4 anos

and if it's async in the trait signature, it means you can use await in the function body.

and if it's `async` in the trait signature, it means you can use `await` in the function body.
igalic comentou há 4 anos (Migrado de github.com)

LGTM

I feel like test_my_resolver/test_my_async_resolver are more coverage oriented than correctness : the valid answer is barely validated, however this is unrelated to this pr

how do you suggest improving those?
ideally, i'd like to do that before a next release, because, more importantly, i'd like to call the next release '1.0'

> LGTM > > I feel like test_my_resolver/test_my_async_resolver are more coverage oriented than correctness : the valid answer is barely validated, however this is unrelated to this pr how do you suggest improving those? ideally, i'd like to do that before a next release, because, more importantly, i'd like to call the next release '1.0'
Proprietário(a)

hum, endpoint() rely way more on find() than I though so in fact any incorrectness on a valid answer would come from find(), never mind my comment

hum, endpoint() rely way more on find() than I though so in fact any incorrectness on a valid answer would come from find(), never mind my comment

Revisores

trinity-1686a aprovou estas modificações há 4 anos
A integração foi executada no cometimento 4e8f12810c.

Passo 1:

No seu repositório, crie um novo ramo e teste as modificações.
git checkout -b feat/async-trait main
git pull origin feat/async-trait

Passo 2:

Integre as modificações e envie para o Forgejo.
git checkout main
git merge --no-ff feat/async-trait
git push origin main
Inicie a sessão para participar neste diálogo.
Sem revisores
Sem etapa
Sem encarregados
2 Participantes
Notificações
Data de vencimento
A data de vencimento é inválida ou está fora do intervalo permitido. Por favor, use o formato 'aaaa-mm-dd'.

Sem data de vencimento definida.

Dependências

Não estão definidas dependências.

Referência: plume/webfinger#11
Carregando…
Ainda não há conteúdo.