mozilla/rust — pull request #1783 by erickt (2012-02-08 19:03:20+00:00)
Title: Adding a str::as_bytes<T>(str, fn([u8] -> T) -> T function

This pattern is used in a couple places, so it'd be nice to abstract it away.