Rattlesnakes are good swimmers, though they are not in a class with species that spend all or most of their lives in water or even with the familiar garter snake.
From anecdotal accounts, we know that rattlesnakes will swim readily enough when their travels in search of food, mates, or refuge require them to cross water.
Rattlesnakes are buoyant and float well, and they propel themselves fairly fast in water with a sinuous motion. They may hold their rattles above water when resting or floating, but they use their tails for propulsion, with their rattles below the surface.
Although rattlesnakes can bite when in or under water, they cannot strike efficiently because they lack a solid base.
You’d have to be pretty careless to get close enough to a swimming rattler to be within striking range and then get it mad enough to bite.