From fa3e2920c0be01874ba40eebc87ed30f97cdeec7 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Mon, 5 Oct 2020 15:45:45 +0200 Subject: =?UTF-8?q?Remove=20@=20syntax=20in=20diagnostics=20macros=20?= =?UTF-8?q?=F0=9F=97=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/library/align.rs | 10 +++++----- src/library/color.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/library') diff --git a/src/library/align.rs b/src/library/align.rs index eaef4d87..ba5de18a 100644 --- a/src/library/align.rs +++ b/src/library/align.rs @@ -53,12 +53,12 @@ fn parse_aligns( // `deferred_center` to true and handle the situation once we know more. if let Some(axis) = axis { if align.v.axis().map_or(false, |a| a != axis) { - error!( - @ctx.f, align.span, + ctx.diag(error!( + align.span, "invalid alignment {} for {} axis", align.v, axis, - ); + )); } else if had[axis as usize] { - error!(@ctx.f, align.span, "duplicate alignment for {} axis", axis); + ctx.diag(error!(align.span, "duplicate alignment for {} axis", axis)); } else { let gen_align = align.v.to_gen(ctx.state.sys); *aligns.get_mut(axis.to_gen(ctx.state.sys)) = gen_align; @@ -66,7 +66,7 @@ fn parse_aligns( } } else { if had == [true, true] { - error!(@ctx.f, align.span, "duplicate alignment"); + ctx.diag(error!(align.span, "duplicate alignment")); } else if deferred_center { // We have two unflushed centers, meaning we know that both axes // are to be centered. diff --git a/src/library/color.rs b/src/library/color.rs index a4958c53..261352ba 100644 --- a/src/library/color.rs +++ b/src/library/color.rs @@ -12,7 +12,7 @@ pub async fn rgb(mut args: Args, ctx: &mut LayoutContext) -> Value { let mut clamp = |component: Option>, default| { component.map_or(default, |c| { if c.v < 0 || c.v > 255 { - error!(@ctx.f, c.span, "should be between 0 and 255") + ctx.diag(error!(c.span, "should be between 0 and 255")); } c.v.max(0).min(255) as u8 }) -- cgit v1.2.3