mbrubeck/robinson — pull request #7 by addyosmani (2014-12-30 14:48:02+00:00)
Title: Update deps & method names to fix build

Master is currently failing to `cargo build` for me using both the Rust nightlies and the stable version (see 1. for info on the error log). This is due to changes made in the upstream `image` dependency used. I've gone ahead and bumped the dep to Alpha 4, which no longer results in these issues.

Once that's done there is however one other build error you'll run into with Alpha 4, which is:

```
error: type `collections::string::String` does not implement any method in scope named `into_ascii_lower`
```

This was renamed upstream to the more readable `into_ascii_lowercase`, so I've also updated the syntax in css.rs to use this. The build now works absolutely fine with the nightlies on OSX.

1. `image` failures:

```
cargo build
Compiling image v0.2.0-alpha.3 (https://github.com/PistonDevelopers/image#a5971d1b)
src/imageops/colorops.rs:30:19: 30:35 error: the parameter type `P` may not live long enough
src/imageops/colorops.rs:30 let mut out = ImageBuffer::new(width, height);
^~~~~~~~~~~~~~~~
src/imageops/colorops.rs:30:19: 30:35 help: consider adding an explicit lifetime bound `P: 'static`...
src/imageops/colorops.rs:30 let mut out = ImageBuffer::new(width, height);
^~~~~~~~~~~~~~~~
src/imageops/colorops.rs:30:19: 30:35 note: ...so that the declared lifetime parameter bounds are satisfied
src/imageops/colorops.rs:30 let mut out = ImageBuffer::new(width, height);
^~~~~~~~~~~~~~~~
src/imageops/colorops.rs:35:17: 35:35 error: the parameter type `P` may not live long enough
src/imageops/colorops.rs:35 out.put_pixel(x, y, p);
^~~~~~~~~~~~~~~~~~
src/imageops/colorops.rs:35:17: 35:35 help: consider adding an explicit lifetime bound `P: 'static`...
src/imageops/colorops.rs:35 out.put_pixel(x, y, p);
^~~~~~~~~~~~~~~~~~
src/imageops/colorops.rs:35:17: 35:35 note: ...so that the declared lifetime parameter bounds are satisfied
src/imageops/colorops.rs:35 out.put_pixel(x, y, p);
^~~~~~~~~~~~~~~~~~
src/png/decoder.rs:592:21: 592:33 error: mismatched types: expected `core::result::Result<&str, core::str::Utf8Error>`, found `core::option::Option<_>` (expected enum core::result::Result, found enum core::option::Option)
src/png/decoder.rs:592 Some("IDAT") => (),
^~~~~~~~~~~~
src/dynimage.rs:471:63: 471:81 error: type `collections::string::String` does not implement any method in scope named `into_ascii_lower`
src/dynimage.rs:471 .map_or("".to_string(), | s | s.to_string().into_ascii_lower());
^~~~~~~~~~~~~~~~~~
src/dynimage.rs:501:63: 501:81 error: type `collections::string::String` does not implement any method in scope named `into_ascii_lower`
src/dynimage.rs:501 .map_or("".to_string(), | s | s.to_string().into_ascii_lower());
^~~~~~~~~~~~~~~~~~
src/buffer.rs:217:18: 222:14 error: the parameter type `PixelType` may not live long enough
src/buffer.rs:217 Some(ImageBuffer {
src/buffer.rs:218 data: buf,
src/buffer.rs:219 width: width,
src/buffer.rs:220 height: height,
src/buffer.rs:221 type_marker: TypeId::of::()
src/buffer.rs:222 })
src/buffer.rs:217:18: 222:14 help: consider adding an explicit lifetime bound `PixelType: 'static`...
src/buffer.rs:217 Some(ImageBuffer {
src/buffer.rs:218 data: buf,
src/buffer.rs:219 width: width,
src/buffer.rs:220 height: height,
src/buffer.rs:221 type_marker: TypeId::of::()
src/buffer.rs:222 })
src/buffer.rs:217:18: 222:14 note: ...so that the declared lifetime parameter bounds are satisfied
src/buffer.rs:217 Some(ImageBuffer {
src/buffer.rs:218 data: buf,
src/buffer.rs:219 width: width,
src/buffer.rs:220 height: height,
src/buffer.rs:221 type_marker: TypeId::of::()
src/buffer.rs:222 })
src/buffer.rs:221:30: 221:53 error: the parameter type `PixelType` may not live long enough
src/buffer.rs:221 type_marker: TypeId::of::()
^~~~~~~~~~~~~~~~~~~~~~~
src/buffer.rs:221:30: 221:53 help: consider adding an explicit lifetime bound `PixelType: 'static`...
src/buffer.rs:221 type_marker: TypeId::of::()
^~~~~~~~~~~~~~~~~~~~~~~
src/buffer.rs:221:30: 221:53 note: ...so that the declared lifetime parameter bounds are satisfied
src/buffer.rs:221 type_marker: TypeId::of::()
^~~~~~~~~~~~~~~~~~~~~~~
src/buffer.rs:359:9: 364:10 error: the parameter type `PixelType` may not live long enough
src/buffer.rs:359 ImageBuffer {
src/buffer.rs:360 data: self.data.clone(),
src/buffer.rs:361 width: self.width,
src/buffer.rs:362 height: self.height,
src/buffer.rs:363 type_marker: self.type_marker
src/buffer.rs:364 }
src/buffer.rs:359:9: 364:10 help: consider adding an explicit lifetime bound `PixelType: 'static`...
src/buffer.rs:359 ImageBuffer {
src/buffer.rs:360 data: self.data.clone(),
src/buffer.rs:361 width: self.width,
src/buffer.rs:362 height: self.height,
src/buffer.rs:363 type_marker: self.type_marker
src/buffer.rs:364 }
src/buffer.rs:359:9: 364:10 note: ...so that the declared lifetime parameter bounds are satisfied
src/buffer.rs:359 ImageBuffer {
src/buffer.rs:360 data: self.data.clone(),
src/buffer.rs:361 width: self.width,
src/buffer.rs:362 height: self.height,
src/buffer.rs:363 type_marker: self.type_marker
src/buffer.rs:364 }
src/buffer.rs:411:9: 422:10 error: the parameter type `PixelType` may not live long enough
src/buffer.rs:411 ImageBuffer {
src/buffer.rs:412 data: Vec::from_elem(
src/buffer.rs:413 (width as u64
src/buffer.rs:414 * height as u64
src/buffer.rs:415 * (Pixel::channel_count(None::<&PixelType>) as u64)
src/buffer.rs:416 ) as uint,
...
src/buffer.rs:411:9: 422:10 help: consider adding an explicit lifetime bound `PixelType: 'static`...
src/buffer.rs:411 ImageBuffer {
src/buffer.rs:412 data: Vec::from_elem(
src/buffer.rs:413 (width as u64
src/buffer.rs:414 * height as u64
src/buffer.rs:415 * (Pixel::channel_count(None::<&PixelType>) as u64)
src/buffer.rs:416 ) as uint,
...
src/buffer.rs:411:9: 422:10 note: ...so that the declared lifetime parameter bounds are satisfied
src/buffer.rs:411 ImageBuffer {
src/buffer.rs:412 data: Vec::from_elem(
src/buffer.rs:413 (width as u64
src/buffer.rs:414 * height as u64
src/buffer.rs:415 * (Pixel::channel_count(None::<&PixelType>) as u64)
src/buffer.rs:416 ) as uint,
...
src/buffer.rs:421:26: 421:49 error: the parameter type `PixelType` may not live long enough
src/buffer.rs:421 type_marker: TypeId::of::()
^~~~~~~~~~~~~~~~~~~~~~~
src/buffer.rs:421:26: 421:49 help: consider adding an explicit lifetime bound `PixelType: 'static`...
src/buffer.rs:421 type_marker: TypeId::of::()
^~~~~~~~~~~~~~~~~~~~~~~
src/buffer.rs:421:26: 421:49 note: ...so that the declared lifetime parameter bounds are satisfied
src/buffer.rs:421 type_marker: TypeId::of::()
^~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 10 previous errors
Could not compile `image`.
```