Skip to content

Commit

Permalink
Move to cargo clippy
Browse files Browse the repository at this point in the history
Using clippy as a library has been deprecated, instead the `cargo
clippy` command should be used instead. To comply with this change
clippy has been removed from the `Cargo.toml` and is now installed with
cargo when building in CI.

This has also lead to a few new clippy issues to show up, this includes
everything in the `font` subdirectory. This has been fixed and `font`
should now be covered by clippy CI too.

This also upgrades all dependencies, as a result this fixes #1341 and
this fixes #1344.
  • Loading branch information
chrisduerr committed Jun 17, 2018
1 parent 0f700a0 commit 5ba34d4
Show file tree
Hide file tree
Showing 18 changed files with 512 additions and 468 deletions.
14 changes: 9 additions & 5 deletions .travis.yml
Expand Up @@ -12,18 +12,22 @@ rust:
- nightly

env:
- FEATURES="clippy"
- FEATURES=""
- CLIPPY="true"
- CLIPPY=""

install:
- if [ -n "$CLIPPY" ]; then cargo install -f clippy; fi

matrix:
fast_finish: true
exclude:
- rust: stable
env: FEATURES="clippy"
env: CLIPPY="true"
- rust: nightly
env: FEATURES=""
env: CLIPPY=""
allow_failures:
- rust: nightly

script:
- cargo test --no-default-features --features "$FEATURES"
- if [ -n "$CLIPPY" ]; then cargo clippy; fi
- if [ -z "$CLIPPY" ]; then cargo test; fi
540 changes: 170 additions & 370 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Cargo.toml
Expand Up @@ -34,7 +34,6 @@ fnv = "1"
unicode-width = "0.1"
arraydeque = "0.4"
glutin = "0.16"
clippy = { version = "*", optional = true }
env_logger = "0.5"
base64 = "0.9.0"

Expand Down
224 changes: 224 additions & 0 deletions font/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions font/src/darwin/byte_order.rs
Expand Up @@ -24,15 +24,15 @@ pub const kCGBitmapByteOrder32Host: u32 = kCGBitmapByteOrder32Little;
pub const kCGBitmapByteOrder32Host: u32 = kCGBitmapByteOrder32Big;

#[cfg(target_endian = "little")]
pub fn extract_rgb(bytes: Vec<u8>) -> Vec<u8> {
pub fn extract_rgb(bytes: &[u8]) -> Vec<u8> {
let pixels = bytes.len() / 4;
let mut rgb = Vec::with_capacity(pixels * 3);

for i in 0..pixels {
let offset = i * 4;
rgb.push(bytes[offset + 2]);
rgb.push(bytes[offset + 1]);
rgb.push(bytes[offset + 0]);
rgb.push(bytes[offset]);
}

rgb
Expand Down

0 comments on commit 5ba34d4

Please sign in to comment.