One thing to note when contributing code, is the project maintainers probably won't commit it right in. Often they'll suggest small (or not so small) improvements (be it stylistic, to make the patch follow the coding style, or suggestions how to better organise the new code).
The important part is: they don't think your patch is bad; they would love it to hit the trunk/master; they are happy at having new people taking time and effort to contribute. Their initial "rejection" isn't, and don't get scared away by it.