The rules about temporary lifetimes, especially in conditional expressions, are a bit inconsistent, but can't be changed significantly without breaking existing code. See this thread for some details: