I had brought my laptop with me. It was removed from my luggage and taken away. When I got it back, it had evidently been booted up and kept running for a while on its battery while they looked through the files I had saved on it to find out if I was a terrorist. Actually, they probably checked to confirm none of it was encrypted and then downloaded a complete copy for them to study at their leisure. Warrantless searches are legal at US border crossings for any reason or none.
This did not bother me at the time because I didn’t realise they intended to copy my hard drive.
What did bother me was that the customs agent assigned to search my luggage picked up items from it – I had come to visit the Grand Canyon, and had brought some British hiking supplies on the basis that I wasn’t sure what would be easy to buy in the South Rim village – and wanted to know, rudely and unpleasantly, “Why did you bring this?”
I was told later that US customs employees are encouraged to be as rude to incoming tourists as possible, in order to see if they can provoke some kind of suspicious response.