This should be done by the caller, as making libos do it will not return a different value if the line was empty or was EOF. Fortunately, we now have String::trim.