It would works on Mars too
One of the most striking findings of the Magnetic Properties Experiments on the rovers is that almost all Martian dust has a magnetic component.
The sweep magnet, located next to the calibration dial, has a strongly magnetic ring to that deflects incoming magnetic particles. The center of the ring would have collected any non-magnetic dust particles but it has stayed remarkably clean. The center of that little magnet is probably the cleanest surface on the entire rover deck.
Here's an image of the Spirit's sweep magnet from Sol 416 (right before the first major cleaning event).
