In the featured image, the cable on the left has a barrel end and a cut end. On the cut end there previously was a USB A connection that was rusted and corroded. This cable is for charging a toy.
The cable on the right has a USB A connection and the cut end had a USB C connection.
Can I simply match the colors of the wires to fix the barrel ended wire to the USB A wire? I.e. white and red from the barrel wire to the white and red on the USB A wire (which also has a black and green)?
Update: I believe that I could use the method described here 2 to determine which wires I should use from the USB A cable, however I am not sure which would be the positive or negative on the barrel cable.