Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Commit ece6fd1

Browse files
committed
Conform AspectRatio to ExpressibleByIntegerLiteral
1 parent 5636c22 commit ece6fd1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Sources/GraphViz/Supporting Types/AspectRatio.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ public enum AspectRatio: Hashable {
2828
case auto
2929
}
3030

31+
32+
// MARK: - ExpressibleByIntegerLiteral
33+
34+
extension AspectRatio: ExpressibleByIntegerLiteral {
35+
public init(integerLiteral value: IntegerLiteralType) {
36+
self = .numeric(Double(value))
37+
}
38+
}
39+
3140
// MARK: - ExpressibleByFloatLiteral
3241

3342
extension AspectRatio: ExpressibleByFloatLiteral {

0 commit comments

Comments
 (0)