From ae07d697a39fa46a1c21c7870062c0330b78fe50 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Mon, 9 Sep 2024 20:51:28 -0400 Subject: [PATCH] make compile times great again --- simpledisplay.d | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/simpledisplay.d b/simpledisplay.d index 44ed15a..8f4c9b2 100644 --- a/simpledisplay.d +++ b/simpledisplay.d @@ -3984,8 +3984,6 @@ private: +/ public CornerStyle cornerStyle() @trusted { version(Windows) { - import std.format; - DWM_WINDOW_CORNER_PREFERENCE dwmCorner; const apiResult = DwmGetWindowAttribute( this.hwnd, @@ -4002,17 +4000,12 @@ private: return _fauxCornerStyle; } - const exMsg = format("DwmGetWindowAttribute() failed with error 0x%x.", apiResult); - throw new Exception(exMsg); + throw new WindowsApiException("DwmGetWindowAttribute", apiResult); } CornerStyle corner; if (!dwmCorner.fromDWM(corner)) { - const exMsg = format( - "DwmGetWindowAttribute() reported an unfamiliar corner preference: %s", - dwmCorner, - ); - throw new Exception(exMsg); + throw ArsdException!"DwmGetWindowAttribute unfamiliar corner preference"(dwmCorner); } return corner; } else { @@ -4023,8 +4016,6 @@ private: /// ditto public void cornerStyle(const CornerStyle corner) @trusted { version(Windows) { - import std.format; - DWM_WINDOW_CORNER_PREFERENCE dwmCorner; if (!corner.toDWM(dwmCorner)) { assert(false, "This should have been impossible because of a final switch."); @@ -4046,8 +4037,7 @@ private: return; } - const exMsg = format("DwmSetWindowAttribute() failed with error 0x%x.", apiResult); - throw new Exception(exMsg); + throw new WindowsApiException("DwmSetWindowAttribute", apiResult); } } else { _fauxCornerStyle = corner;