The construction of the Taff Vale Railway and the Bute West Dock in the 1840s resulted in Cardiff surpassing Swansea as the principal coal port in South Wales, and by 1871 Cardiff's population exceeded that of Swansea. In the late 19th century, Swansea copper smelters faced increased foreign competition, and some of the leading smelters in the region diversified into other non-ferrous metals. In the ferrous sector, rapid growth in demand for tinplate - particularly in the USA - facilitated a local boom; the imposition of the McKinley Tariff in 1891 caused a significant fall in production, but tinplate continued to be a significant local economic activity into the first half of the 20th century, with demand buoyant during the two world wars.