Skip to content

Commit

Permalink
chore: more
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Apr 12, 2024
1 parent e6e3323 commit 5e16348
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions frb_codegen/src/library/codegen/parser/function_parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ impl<'a, 'b> FunctionParser<'a, 'b> {
info = self.transform_fn_info(info);

let codec_mode_pack = compute_codec_mode_pack(&attributes, force_codec_mode_pack);
let mode = compute_func_mode(&attributes, &info);
let await_stream = TODO;
let (mode, await_stream) = compute_func_mode_and_await_stream(&attributes, &info);

if info.ignore_func {
return Ok(None);
Expand Down Expand Up @@ -181,11 +180,14 @@ impl<'a, 'b> FunctionParser<'a, 'b> {
}
}

fn compute_func_mode(attributes: &FrbAttributes, info: &FunctionPartialInfo) -> IrFuncMode {
fn compute_func_mode_and_await_stream(
attributes: &FrbAttributes,
info: &FunctionPartialInfo,
) -> (IrFuncMode, bool) {
info.mode.unwrap_or(if attributes.sync() {
IrFuncMode::Sync
(IrFuncMode::Sync, false)
} else {
IrFuncMode::Normal
(IrFuncMode::Normal, !attributes.dart_async())
})
}

Expand Down

0 comments on commit 5e16348

Please sign in to comment.