Skip to content

Commit

Permalink
fix more
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Dec 5, 2024
1 parent 51ab65e commit 57db31a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
26 changes: 19 additions & 7 deletions crates/next-core/src/app_segment_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,23 @@ pub struct NextSegmentConfigParsingIssue {
source: ResolvedVc<IssueSource>,
}

#[turbo_tasks::value_impl]
impl NextSegmentConfigParsingIssue {
#[turbo_tasks::function]
pub fn new(
ident: ResolvedVc<AssetIdent>,
detail: ResolvedVc<StyledString>,
source: ResolvedVc<IssueSource>,
) -> Vc<Self> {
Self {
ident,
detail,
source,
}
.cell()
}
}

#[turbo_tasks::value_impl]
impl Issue for NextSegmentConfigParsingIssue {
#[turbo_tasks::function]
Expand Down Expand Up @@ -333,13 +350,8 @@ fn parse_config_value(
let detail =
StyledString::Text(format!("{detail} Got {explainer}.{hints}").into()).resolved_cell();

NextSegmentConfigParsingIssue {
ident: source.ident(),
detail,
source: issue_source(source, span),
}
.cell()
.emit();
NextSegmentConfigParsingIssue::new(source.ident(), *detail, issue_source(source, span))
.emit();
};

match &*ident.sym {
Expand Down
10 changes: 4 additions & 6 deletions crates/next-core/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,11 @@ impl Issue for NextSourceConfigParsingIssue {

fn emit_invalid_config_warning(ident: Vc<AssetIdent>, detail: &str, value: &JsValue) {
let (explainer, hints) = value.explain(2, 0);
NextSourceConfigParsingIssue {
NextSourceConfigParsingIssue::new(
ident,
detail: StyledString::Text(format!("{detail} Got {explainer}.{hints}").into())
.resolved_cell(),
}
.resolved_cell()
.emit()
StyledString::Text(format!("{detail} Got {explainer}.{hints}").into()).cell(),
)
.emit();
}

fn parse_route_matcher_from_js_value(
Expand Down

0 comments on commit 57db31a

Please sign in to comment.