Unlike move
and borrow
, which place extra constraints on the typical compiler behavior, copy
's behavior is captured pretty much by just a regular function:
func copy<T>(_ x: borrow T) -> T {
return x
}
Unlike move
and borrow
, which place extra constraints on the typical compiler behavior, copy
's behavior is captured pretty much by just a regular function:
func copy<T>(_ x: borrow T) -> T {
return x
}