From d0970daacda0b6f6c2077c2f81948536b574bbe9 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 12 Jun 2020 09:19:29 -0400 Subject: make std deno-lint clean (#6240) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek IwaƄczuk --- std/fmt/printf.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'std/fmt/printf.ts') diff --git a/std/fmt/printf.ts b/std/fmt/printf.ts index 8c2f8d034..bf5feaaed 100644 --- a/std/fmt/printf.ts +++ b/std/fmt/printf.ts @@ -221,7 +221,7 @@ class Printf { flags.width += val; } // switch c break; - case State.PRECISION: + case State.PRECISION: { if (c === "*") { this.handleWidthOrPrecisionRef(WorP.PRECISION); break; @@ -236,6 +236,7 @@ class Printf { flags.precision *= 10; flags.precision += val; break; + } default: throw new Error("can't be here. bug."); } // switch state @@ -627,8 +628,7 @@ class Printf { switch (typeof val) { case "number": return this.fmtNumber(val as number, 16, upper); - break; - case "string": + case "string": { const sharp = this.flags.sharp && val.length !== 0; let hex = sharp ? "0x" : ""; const prec = this.flags.precision; @@ -647,7 +647,7 @@ class Printf { hex = hex.toUpperCase(); } return this.pad(hex); - break; + } default: throw new Error( "currently only number and string are implemented for hex" -- cgit v1.2.3