Sweeping processes and rate independence