Skip to content

Commit

Permalink
Change Task typing
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacMarovitz committed Jan 12, 2024
1 parent 643ad89 commit 2f3099f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Whisky/Views/Bottle/Pins/PinView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ struct PinView: View {
.task {
name = pin.name
guard let peFile = program.peFile else { return }
let task = Task<Image?, Never>.detached {
guard let image = peFile.bestIcon() else { return nil }
let task = Task.detached {
guard let image = peFile.bestIcon() else { return nil as Image? }
return Image(nsImage: image)
}
self.image = await task.value
Expand Down
4 changes: 2 additions & 2 deletions Whisky/Views/Programs/ProgramView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ struct ProgramView: View {
}
.task {
guard let peFile = program.peFile else { return }
let task = Task<Image?, Never>.detached {
guard let image = peFile.bestIcon() else { return nil }
let task = Task.detached {
guard let image = peFile.bestIcon() else { return nil as Image? }
return Image(nsImage: image)
}
self.image = await task.value
Expand Down

0 comments on commit 2f3099f

Please sign in to comment.