Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created July 10, 2023 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/3dc7613ccdabe408af430ca3c9851910 to your computer and use it in GitHub Desktop.
Save laevandus/3dc7613ccdabe408af430ca3c9851910 to your computer and use it in GitHub Desktop.
let method: BrewMethod = .espresso
// Before
let title: String = {
switch method {
case .espresso: return "Espresso"
case .frenchPress: return "French Press"
case .chemex: return "Chemex"
}
}()
// After
let title2: String =
switch method {
case .espresso: "Espresso"
case .frenchPress: "French Press"
case .chemex: "Chemex"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment