Feature: async trait
#11
Fusionnée
igalic
a fusionné 8 révision(s) à partir de plume/webfinger:feat/async-trait
vers main
il y a 4 ans
Chargement…
Référencer dans un nouveau ticket
Il n'existe pas encore de contenu.
Supprimer la branche 'plume/webfinger:feat/async-trait'
Supprimer une branche est permanent. Cela NE PEUVENT être annulées. Continuer ?
add a feature (behind a off-by-default flag) to use async trait implementations.
for now, this doesn't work, because
impl String
is not (necessarily)Send
safe.current status:
Codecov Report
86.45% <81.25%> (-1.43%)
97.54% <98.50%> (+3.42%)
100.00% <100.00%> (ø)
100.00% <100.00%> (ø)
Continue to review full report at Codecov.
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
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;
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
@ -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;
and if it's
async
in the trait signature, it means you can useawait
in the function body.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'
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
Relecteurs
4e8f12810c
.É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.