Let's say you're a level 8 druid, so you have 4 hours per use of Wildshape.
Now, at 11:00, you expend one use of it to turn yourself into a Raven (or any other beast).
From 12:00 to 13:00, you take a rest, while still being in your raven form (which works).
Obviously, you can stay in raven form until 15:00, at which point you revert to your regular form.
Then, from 13:00 to 15:00, you are in raven form. The PHB states on Wildshape:
You can use this feature twice. You regain expended uses when you finish a short or long rest.
You just finished a short rest, meaning you would still be transformed and get both uses back (assuming you expend your use of Wildshape when you transform, not when you end it, which would make this question irrelevant). This might not be a balancing issue if you're a CR0 raven, but it might very well be relevant for other Wildshapes.
Hence my question:
If you finish a short rest while Wildshaped, do you get both uses back and can therefore "overstock" your total maximum Wildshape time per rest?
Or would you simply auto-expend one use, and reset the timer on that use?