Rings having zero-divisor graphs of small diameter or large girth