Would it have been less out of place if there had been more than one guy with a rifle?Is it about noon? Is he wearing the hammer on a tool belt? Is he wearing a shirt that identifies himself as a contractor, maybe with a group of others who OC hammers, then it probably wouldn't be out of place.
1 lone guy with a hammer in his hand in mcdonalds would be out of place
Your comparison would be closer if the carpenter had his hammer hanging from his tool belt, much like the op's friend had his rifle slung (not in his hands).
if the guy with the rifle, or the (hypothetical) guy with the hammer, had the tool in his hands, or waving it around, and/or yelling or acting strangely, then of course, something should be done to stop him.
I do agree though, that is is "unusual" to carry a rifle (even slung) or hammer (even in a tool belt) into a fast food restaurant.
i wear a tool belt most days, but take it off and leave it in the truck or on the job site.