From 80bf3da17d010cf8ac3e2e9e500d3c1f2d231d7d Mon Sep 17 00:00:00 2001 From: topecongiro Date: Sun, 18 Feb 2018 18:11:38 +0900 Subject: [PATCH] Use debug_assert_eq! to avoid comparing PathBuf on release Comparing `PathBuf` adds noticeable overhead, avoid it in release build. --- rustfmt-core/src/codemap.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rustfmt-core/src/codemap.rs b/rustfmt-core/src/codemap.rs index 7292f7f35d1..6edfb5b8fbe 100644 --- a/rustfmt-core/src/codemap.rs +++ b/rustfmt-core/src/codemap.rs @@ -71,7 +71,7 @@ fn lookup_line_range(&self, span: Span) -> LineRange { let lo = self.lookup_line(span.lo()).unwrap(); let hi = self.lookup_line(span.hi()).unwrap(); - assert_eq!( + debug_assert_eq!( lo.fm.name, hi.fm.name, "span crossed file boundary: lo: {:?}, hi: {:?}", lo, hi -- 2.44.0