Skip to content

Commit 1675098

Browse files
committed
Observation: Fix warnings about unused variables.
1 parent cbbfd17 commit 1675098

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Macros/Sources/ObservationMacros/ObservableMacro.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ public struct ObservationTrackedMacro: AccessorMacro {
338338
return []
339339
}
340340

341-
guard let container = context.lexicalContext[0].as(ClassDeclSyntax.self) else {
341+
guard context.lexicalContext[0].as(ClassDeclSyntax.self) != nil else {
342342
return []
343343
}
344344

@@ -406,11 +406,11 @@ extension ObservationTrackedMacro: PeerMacro {
406406
) throws -> [DeclSyntax] {
407407
guard let property = declaration.as(VariableDeclSyntax.self),
408408
property.isValidForObservation,
409-
let identifier = property.identifier?.trimmed else {
409+
property.identifier?.trimmed != nil else {
410410
return []
411411
}
412412

413-
guard let container = context.lexicalContext[0].as(ClassDeclSyntax.self) else {
413+
guard context.lexicalContext[0].as(ClassDeclSyntax.self) != nil else {
414414
return []
415415
}
416416

0 commit comments

Comments
 (0)