clean-up `SourceFileRange::as_str` (#15401)

changelog: none