It's all foolish. If someone really is allergic, given that WN doesn't clean aircraft between flights, there are probably wrappers stuffed in the seatback pockets, lying on the floor and the like. Pax also bring their own snacks and don't pay attention to the announcement.
This is one of those things which WN may do for liability reasons and may do to suggest that they care, but if someone is truly allergic, they should take no comfort.