Replace let ... if with more idiomatic if-let.