File tree Expand file tree Collapse file tree 5 files changed +21
-21
lines changed
Sources/SwiftRefactor/PackageManifest Expand file tree Collapse file tree 5 files changed +21
-21
lines changed Original file line number Diff line number Diff line change @@ -328,7 +328,7 @@ fileprivate extension TargetDescription.Dependency {
328
328
case . target( name: let name) ,
329
329
. byName( name: let name) ,
330
330
. product( name: let name, package : _) :
331
- name
331
+ return name
332
332
}
333
333
}
334
334
}
Original file line number Diff line number Diff line change @@ -25,13 +25,13 @@ extension ManifestEditError: CustomStringConvertible {
25
25
public var description : String {
26
26
switch self {
27
27
case . cannotFindPackage:
28
- " invalid manifest: unable to find 'Package' declaration "
28
+ return " invalid manifest: unable to find 'Package' declaration "
29
29
case . cannotFindTargets:
30
- " unable to find package targets in manifest "
30
+ return " unable to find package targets in manifest "
31
31
case . cannotFindTarget( targetName: let name) :
32
- " unable to find target named ' \( name) ' in package "
32
+ return " unable to find target named ' \( name) ' in package "
33
33
case . cannotFindArrayLiteralArgument( argumentName: let name, node: _) :
34
- " unable to find array literal for ' \( name) ' argument "
34
+ return " unable to find array literal for ' \( name) ' argument "
35
35
}
36
36
}
37
37
}
Original file line number Diff line number Diff line change @@ -68,9 +68,9 @@ public enum PackageDependency: Sendable {
68
68
extension PackageDependency : ManifestSyntaxRepresentable {
69
69
func asSyntax( ) -> ExprSyntax {
70
70
switch self {
71
- case . fileSystem( let filesystem) : filesystem. asSyntax ( )
72
- case . sourceControl( let sourceControl) : sourceControl. asSyntax ( )
73
- case . registry( let registry) : registry. asSyntax ( )
71
+ case . fileSystem( let filesystem) : return filesystem. asSyntax ( )
72
+ case . sourceControl( let sourceControl) : return sourceControl. asSyntax ( )
73
+ case . registry( let registry) : return registry. asSyntax ( )
74
74
}
75
75
}
76
76
}
Original file line number Diff line number Diff line change @@ -42,12 +42,12 @@ extension ProductDescription: ManifestSyntaxRepresentable {
42
42
/// to check the precondition.
43
43
private var functionName : String {
44
44
switch type {
45
- case . executable: " executable "
46
- case . library( _) : " library "
47
- case . macro: " macro "
48
- case . plugin: " plugin "
49
- case . snippet: " snippet "
50
- case . test: " test "
45
+ case . executable: return " executable "
46
+ case . library( _) : return " library "
47
+ case . macro: return " macro "
48
+ case . plugin: return " plugin "
49
+ case . snippet: return " snippet "
50
+ case . test: return " test "
51
51
}
52
52
}
53
53
Original file line number Diff line number Diff line change @@ -75,13 +75,13 @@ extension TargetDescription: ManifestSyntaxRepresentable {
75
75
/// The function name in the package manifest.
76
76
private var functionName : String {
77
77
switch type {
78
- case . binary: " binaryTarget "
79
- case . executable: " executableTarget "
80
- case . library: " target "
81
- case . macro: " macro "
82
- case . plugin: " plugin "
83
- case . system: " systemLibrary "
84
- case . test: " testTarget "
78
+ case . binary: return " binaryTarget "
79
+ case . executable: return " executableTarget "
80
+ case . library: return " target "
81
+ case . macro: return " macro "
82
+ case . plugin: return " plugin "
83
+ case . system: return " systemLibrary "
84
+ case . test: return " testTarget "
85
85
}
86
86
}
87
87
You can’t perform that action at this time.
0 commit comments