Mending basically gives a fishing rod infinite durability due to the fact that fishing gives xp, which is great for AFK fish farms
Though I’m pretty sure you can get fishing rods pre-enchanted with mending from fishing, so yes, a book would be better on something else