Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to current rust #30

Merged
merged 3 commits into from Apr 10, 2014
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Update to current rust: Vec<T> changes.

  • Loading branch information
Ms2ger committed Apr 10, 2014
commit 81631a1d2cb31e1e70690f356e10d6ec911fe0a2
4 lib.rs
@@ -76,7 +76,7 @@ pub fn load_png(path: &Path) -> Result<Image,~str> {
Ok(b) => b,
Err(e) => return Err(format!("could not read file: {}", e.desc))
};
load_png_from_memory(buf)
load_png_from_memory(buf.as_slice())
}

pub fn load_png_from_memory(image: &[u8]) -> Result<Image,~str> {
@@ -307,7 +307,7 @@ mod test {
Err(e) => fail!(e)
};
let bs = bench::benchmark(|b| b.iter(|| {
match load_png_from_memory(buf) {
match load_png_from_memory(buf.as_slice()) {
Err(m) => fail!(m),
Ok(image) => {
assert_eq!(image.color_type, c);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.