File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Sources/OpenGraph/Attribute/Attribute Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -223,11 +223,27 @@ extension Attribute {
223223 }
224224 }
225225
226+ public init < R: Rule > ( _ rule: R , initialValue: Value ) where R. Value == Value {
227+ self = withUnsafePointer ( to: rule) { pointer in
228+ withUnsafePointer ( to: initialValue) { initialValuePointer in
229+ Attribute ( body: pointer, value: initialValuePointer) { R . _update }
230+ }
231+ }
232+ }
233+
226234 public init < R: StatefulRule > ( _ rule: R ) where R. Value == Value {
227235 self = withUnsafePointer ( to: rule) { pointer in
228236 Attribute ( body: pointer, value: nil ) { R . _update }
229237 }
230238 }
239+
240+ public init < R: StatefulRule > ( _ rule: R , initialValue: Value ) where R. Value == Value {
241+ self = withUnsafePointer ( to: rule) { pointer in
242+ withUnsafePointer ( to: initialValue) { initialValuePointer in
243+ Attribute ( body: pointer, value: initialValuePointer) { R . _update }
244+ }
245+ }
246+ }
231247}
232248
233249@_silgen_name ( " OGGraphCreateAttribute " )
You can’t perform that action at this time.
0 commit comments