Skip to content

Commit 67e341c

Browse files
authored
Update MediaType.swift
Fixes #92.
1 parent 45bc3e5 commit 67e341c

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

Sources/Html/MediaType.swift

+33-33
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ public struct Application: RawRepresentable, Sendable {
6161
self.rawValue = rawValue
6262
}
6363

64-
public static let javascript = Application(rawValue: "javascript")
65-
public static let json = Application(rawValue: "json")
66-
public static let xml = Application(rawValue: "xml")
67-
public static let xWwwFormUrlencoded = Application(rawValue: "x-www-form-url-encoded")
64+
public static let javascript = Self(rawValue: "javascript")
65+
public static let json = Self(rawValue: "json")
66+
public static let xml = Self(rawValue: "xml")
67+
public static let xWwwFormUrlencoded = Self(rawValue: "x-www-form-url-encoded")
6868
}
6969

7070
public struct Audio: RawRepresentable, Sendable {
@@ -74,10 +74,10 @@ public struct Audio: RawRepresentable, Sendable {
7474
self.rawValue = rawValue
7575
}
7676

77-
public static let aiff = Audio(rawValue: "aiff")
78-
public static let ogg = Audio(rawValue: "ogg")
79-
public static let mpeg = Audio(rawValue: "mpeg")
80-
public static let wav = Audio(rawValue: "wav")
77+
public static let aiff = Self(rawValue: "aiff")
78+
public static let ogg = Self(rawValue: "ogg")
79+
public static let mpeg = Self(rawValue: "mpeg")
80+
public static let wav = Self(rawValue: "wav")
8181
}
8282

8383
public struct Font: RawRepresentable, Sendable {
@@ -87,12 +87,12 @@ public struct Font: RawRepresentable, Sendable {
8787
self.rawValue = rawValue
8888
}
8989

90-
public static let collection = Audio(rawValue: "collection")
91-
public static let otf = Audio(rawValue: "otf")
92-
public static let sfnt = Audio(rawValue: "sfnt")
93-
public static let ttf = Audio(rawValue: "ttf")
94-
public static let woff = Audio(rawValue: "woff")
95-
public static let woff2 = Audio(rawValue: "woff2")
90+
public static let collection = Self(rawValue: "collection")
91+
public static let otf = Self(rawValue: "otf")
92+
public static let sfnt = Self(rawValue: "sfnt")
93+
public static let ttf = Self(rawValue: "ttf")
94+
public static let woff = Self(rawValue: "woff")
95+
public static let woff2 = Self(rawValue: "woff2")
9696
}
9797

9898
public struct Image: RawRepresentable, Sendable {
@@ -102,12 +102,12 @@ public struct Image: RawRepresentable, Sendable {
102102
self.rawValue = rawValue
103103
}
104104

105-
public static let bmp = Image(rawValue: "bmp")
106-
public static let jpeg = Image(rawValue: "jpeg")
107-
public static let gif = Image(rawValue: "gif")
108-
public static let png = Image(rawValue: "png")
109-
public static let svg = Image(rawValue: "svg+xml")
110-
public static let tiff = Image(rawValue: "tiff")
105+
public static let bmp = Self(rawValue: "bmp")
106+
public static let jpeg = Self(rawValue: "jpeg")
107+
public static let gif = Self(rawValue: "gif")
108+
public static let png = Self(rawValue: "png")
109+
public static let svg = Self(rawValue: "svg+xml")
110+
public static let tiff = Self(rawValue: "tiff")
111111
}
112112

113113
public struct Multipart: RawRepresentable, Sendable {
@@ -117,11 +117,11 @@ public struct Multipart: RawRepresentable, Sendable {
117117
self.rawValue = rawValue
118118
}
119119

120-
public static let alternative = Multipart(rawValue: "alternative")
121-
public static let digest = Multipart(rawValue: "digest")
122-
public static let mixed = Multipart(rawValue: "mixed")
123-
public static let parallel = Multipart(rawValue: "parallel")
124-
public static let formData = Multipart(rawValue: "form-data")
120+
public static let alternative = Self(rawValue: "alternative")
121+
public static let digest = Self(rawValue: "digest")
122+
public static let mixed = Self(rawValue: "mixed")
123+
public static let parallel = Self(rawValue: "parallel")
124+
public static let formData = Self(rawValue: "form-data")
125125
}
126126

127127
public struct Text: RawRepresentable, Sendable {
@@ -131,10 +131,10 @@ public struct Text: RawRepresentable, Sendable {
131131
self.rawValue = rawValue
132132
}
133133

134-
public static let css = Text(rawValue: "css")
135-
public static let csv = Text(rawValue: "csv")
136-
public static let html = Text(rawValue: "html")
137-
public static let plain = Text(rawValue: "plain")
134+
public static let css = Self(rawValue: "css")
135+
public static let csv = Self(rawValue: "csv")
136+
public static let html = Self(rawValue: "html")
137+
public static let plain = Self(rawValue: "plain")
138138
}
139139

140140
public struct Video: RawRepresentable, Sendable {
@@ -144,9 +144,9 @@ public struct Video: RawRepresentable, Sendable {
144144
self.rawValue = rawValue
145145
}
146146

147-
public static let mp4 = Video(rawValue: "mp4")
148-
public static let ogg = Video(rawValue: "ogg")
149-
public static let webm = Video(rawValue: "webm")
147+
public static let mp4 = Self(rawValue: "mp4")
148+
public static let ogg = Self(rawValue: "ogg")
149+
public static let webm = Self(rawValue: "webm")
150150
}
151151

152152
public struct Charset: RawRepresentable, Sendable {
@@ -156,7 +156,7 @@ public struct Charset: RawRepresentable, Sendable {
156156
self.rawValue = rawValue
157157
}
158158

159-
public static let utf8: Charset = "utf-8"
159+
public static let utf8: Self = "utf-8"
160160
// TODO: http://www.iana.org/assignments/character-sets/character-sets.xhtml
161161
}
162162

0 commit comments

Comments
 (0)