title: What does "case" mean without switch statement in Swift?
body: <p>I ran into this code which is part of a Swift implementation of a linked list in the <a href="https://github.com/raywenderlich/swift-algorithm-club/tree/master/Linked%20List" rel="noreferrer">Swift Algorithm Club</a>. Throughout the implementation the author uses <code>case let</code> following a while statement right before unwrapping an optional. I've never seen the case keyword used outside of the context of a switch statement, and I'm wondering what exactly it does? Does it somehow cast the <code>let next? = node.next</code> part to true or false, maybe depending on whether <code>next?</code> becomes nil or not?</p>
  
  <pre><code>public var last: Node? {
      if var node = head {
          while case let next? = node.next {
              node = next
          }
          return node
      } else {
          return nil
      }
  }
  </code></pre>