Skip to content

Commit

Permalink
Fix clippy and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzlbg committed Feb 11, 2019
1 parent 413f843 commit 3548657
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ matrix:
- name: "clippy"
install: true
rust: nightly
before_script: rustup component add clippy-preview
script: cargo clippy -- -D clippy::pedantic
script: |
if rustup component add clippy-preview ; then
cargo clippy -- -D clippy::pedantic
fi
script:
- cargo test
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ impl TestGenerator {
/// c.replace("FOO", "foo")
/// });
pub fn const_cname<F>(&mut self, f: F) -> &mut Self
where
where
F: Fn(&str) -> String + 'static,
{
self.const_cname = Box::new(f);
Expand Down Expand Up @@ -1285,6 +1285,7 @@ impl<'a> Generator<'a> {
cty
}

#[clippy::allow(clippy::similar_names)]
fn test_const(&mut self, name: &str, rust_ty: &str) {
if (self.opts.skip_const)(name) {
return;
Expand Down Expand Up @@ -1349,7 +1350,6 @@ impl<'a> Generator<'a> {
"#,
ty = rust_ty,
name = name

));
}
self.tests.push(format!("const_{}", name));
Expand Down
2 changes: 0 additions & 2 deletions testcrate/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,4 @@ fn main() {
t => t.to_string(),
})
.generate("src/t2.rs", "t2gen_cxx.rs");


}
1 change: 0 additions & 1 deletion testcrate/tests/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ fn t2_cxx() {
}
}


fn output(cmd: &mut Command) -> (String, ExitStatus) {
let output = cmd.output().unwrap();
let stdout = String::from_utf8(output.stdout).unwrap();
Expand Down

0 comments on commit 3548657

Please sign in to comment.