The second version is more clear, since a true legato, by definition, wouldn't be interrupted by a rest. The pedal, in a situation like this, is for tone color rather that helping sustain legato. (Note the error in the second measure. It should be a quarter note tied to a sixteenth.)
The first example is ambiguous, leaving the pianist uncertain of the meaning of the rest, but it clearly implies removing one's hands from the keys (non-legato) even though the pedal holds the sound.
Note the errors in the second measure. The right hand should begin with a quarter note tied to a sixteenth, and the left hand should begin with a quarter note tied to a dotted eighth.
