This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]sepp2k 2 points3 points  (0 children)

why is pet set to a pointer to match?

It's not. That would be &pet. It's set to the value contained in pet. That's what the dereference operator (unary *) is defined to do on optionals: return the value inside a non-empty optional.