Inflation cooled faster than expected in June as a brief peace deal between Iran and the U.S. resulted in lower oil prices, according to federal data published Tuesday.