US inflation cooled in June despite rising oil prices after Iran strikes, easing pressure on the Federal Reserve to raise interest rates.