I'm trying to power Arduino Nano with 7.4V LiPo battery and use it to run 2 DC motor using L293D. I have figured out how power it with the connection just like in the figure below(the diagram uses Uno and the battery is 9V but try to imagine it as Nano and 7.4V). I also found another way to power it by connecting the red wire from battery to Vin on the Arduino instead of connecting it to the positive power rail.
So, my question is which is a safer way to power it and what is the difference and risk of one the way I mention.