Feature: async trait
#11
Sloučený
igalic
sloučil 8 commity z větve plume/webfinger:feat/async-trait
do větve main
před před 4 roky
Načítá se…
Odkázat v novém úkolu
Není zde žádný obsah.
Smazat větev „plume/webfinger:feat/async-trait“
Smazání větve je trvalé. NEMŮŽE být vráceno zpět. Pokračovat?
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
Posuzovatelé
4e8f12810c
.Krok 1:
Z vašeho repositáře projektu se podívejte na novou větev a vyzkoušejte změny.Krok 2:
Slučte změny a aktualizujte je na Forgejo.