In an Oscar-nominated performance, Reese Witherspoon plays Cheryl Strayed, a woman who had been a desperate junky, but got her life together and hiked the Pacific Crest Trail, writing about her experience in a memoir titled "Strayed."
Early on during her hike, somewhere between the town of Mojave and Kennedy Meadows, she sees and hears a rattlesnake rattling on the trail. It startles her, but she keeps calm and remains still and slowly walks around it, then runs away as fast as she can. I was surprised to see this behavior in a movie because it is so unexpected to see someone do exactly what you should do when you encounter a rattlesnake in the middle of a trail (except for the running - a rattlesnake is not able to race after you so.) Such an undramatic event doesn't have enough "action" for a movie. Why have the protagonist avoid a problem when you can show them violently obliterate it?
I don't think Strayed wrote about seeing a rattlesnake in her memoir, (I only skimmed the book) but she did mention a few times that she was afraid she might see one, so this scene was probably meant to show that she encountered and overcame one of her fears on her journey. (For any of us who have encountered many rattlesnakes on many trails, it seems rather insignificant, and certainly nowhere near as impressive as the rest of her journey. Total respect to all the PCT hikers.
The snake used in the movie is apparently an Eastern Diamond-backed Rattlesnake which is not found in California. I thought it might be a Mojave Rattlesnake, which could possibly be found on that part of the trail, but I've been convinced otherwise. We never see Reese Witherspoon in a shot with the snake so the legs and feet and back we are on screen might be those of a stand-in.