From 010ed333a633ffdadd23c3e9cfc41ce863148a5a Mon Sep 17 00:00:00 2001 From: Marco Farrugia Date: Sun, 22 Jul 2018 13:29:26 -0400 Subject: [PATCH] Fix warnings in examples. --- examples/ffi/c_calling_rust/BUILD | 2 ++ examples/ffi/rust_calling_c/c/matrix_test.c | 2 +- examples/hello_runfiles/src/lib.rs | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/ffi/c_calling_rust/BUILD b/examples/ffi/c_calling_rust/BUILD index c00703c758..940af5f62b 100644 --- a/examples/ffi/c_calling_rust/BUILD +++ b/examples/ffi/c_calling_rust/BUILD @@ -12,6 +12,8 @@ rust_library( cc_library( name = "wrapper", srcs = [":rusty"], + # We could link dynamically by setting crate_type to cdylib + linkstatic = True, ) cc_test( diff --git a/examples/ffi/rust_calling_c/c/matrix_test.c b/examples/ffi/rust_calling_c/c/matrix_test.c index adeade4b4e..28c433c3dd 100644 --- a/examples/ffi/rust_calling_c/c/matrix_test.c +++ b/examples/ffi/rust_calling_c/c/matrix_test.c @@ -24,7 +24,7 @@ void matrix_print(const Matrix* m) { for (size_t j = 0; j < m->cols; ++j) { uint64_t val = 0; matrix_at(m, i, j, &val); - printf("%llu ", val); + printf("%lu ", val); } printf("\n"); } diff --git a/examples/hello_runfiles/src/lib.rs b/examples/hello_runfiles/src/lib.rs index 89a112015e..3e8aa63cfc 100644 --- a/examples/hello_runfiles/src/lib.rs +++ b/examples/hello_runfiles/src/lib.rs @@ -22,7 +22,6 @@ pub fn get_runfiles_dir() -> io::Result { mod test { use super::*; - use std::io; use std::io::prelude::*; use std::fs::File;