Andrey Rublev beat home-favourite Yannick Hanfmann in straight sets to reach the quarter-finals at Halle.