The stock market gave up ground on Wednesday, continuing a tug of war between bulls and bears as investors try to figure out the likely future direction for stocks. The U.S. economy has in general been stubbornly strong despite global pressures, but some chinks in the domestic economic armor have started to appear, and that has made some increasingly fearful that the 10-year-old bull market is coming to an end. Even amid that gloomy outlook, some stocks posted solid gains. Shoe Carnival (SCVL -0.58%), LGI Homes (LGIH 0.88%), and Unifirst (UNF -0.16%) were among the top performers. Here's why they did so well.

Shoe Carnival gets booted higher

Shares of Shoe Carnival soared 22% after the shoe retailer reported its fourth-quarter financial results. The footwear specialist said that sales eased lower from the year-earlier period, but that was primarily because this year's quarter had one less week in it, and comparable-store sales were up a respectable 4.7%. CEO Clifton Sifford attributed much of the performance to strong sales of women's boots, but corporate restructuring that included closing some underperforming stores undoubtedly contributed to Shoe Carnival's success as well. Growth in 2019 could be modest, but investors feel a lot better about Shoe Carnival's prospects for the coming year than they have in a long time.

LGI Homes logo, which is the letters of the name shaped like a house.

Image source: LGI Homes.

LGI looks to capitalize on lower rates

LGI Homes saw its stock pick up 5% on a good day for homebuilders in general. Some of LGI's peers reported mixed quarterly results today, but their executives made comments that suggested that the combination of lower mortgage rates and relatively modest increases in housing prices recently should help buyers during the key spring homebuying season. LGI in particular has worked hard to help first-time homebuyers purchase places to live, and that's an area that's been underserved recently. If conditions keep improving, then LGI should be in a prime position to benefit from more buying interest.

Check out the latest earnings call transcripts for Shoe Carnival, LGI Homes, and Unifirst.

Unifirst makes its shareholders cheer

Finally, shares of Unifirst rose more than 8%. The provider of uniform, workwear, and facility services said that revenue rose modestly in the second quarter of its 2019 fiscal year, and despite a small drop in operating margin, profit levels were better than Unifirst had expected. The favorable settlement of a dispute with a supplier related to customer relationship management systems helped boost Unifirst's bottom line for the period, and CEO Steven Sintros also said that Unifirst's expectations for the full fiscal year were now better than it had previously projected. As long as activity levels in the employment market remain robust, Unifirst should have plenty of support for its business performance.