From f3b57a1e6bb899f7fd79038f701a6773b696134a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20F=C3=B6rster?= Date: Sat, 28 Dec 2019 19:29:36 +0100 Subject: [PATCH] Fix clippy warnings --- .gitignore | 1 - crates/texlab_citeproc/build.rs | 5 +---- crates/texlab_citeproc/src/name/mod.rs | 5 ++++- crates/texlab_citeproc/src/ris.rs | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index b2a930a8c..e6f0a2f37 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,3 @@ target/ /.idea tarpaulin-report.html crates/**/Cargo.lock -crates/texlab_citeproc/src/name/parser.rs diff --git a/crates/texlab_citeproc/build.rs b/crates/texlab_citeproc/build.rs index 228a42992..ca5c2836d 100644 --- a/crates/texlab_citeproc/build.rs +++ b/crates/texlab_citeproc/build.rs @@ -1,6 +1,3 @@ fn main() { - lalrpop::Configuration::new() - .generate_in_source_tree() - .process() - .unwrap(); + lalrpop::process_root().unwrap(); } diff --git a/crates/texlab_citeproc/src/name/mod.rs b/crates/texlab_citeproc/src/name/mod.rs index 7668d0fff..3ddd8a12b 100644 --- a/crates/texlab_citeproc/src/name/mod.rs +++ b/crates/texlab_citeproc/src/name/mod.rs @@ -1,7 +1,10 @@ // Ported from: https://github.com/michel-kraemer/citeproc-java/blob/master/citeproc-java/grammars/InternalName.g4 // Michel Kraemer // Apache License 2.0 -mod parser; +mod parser { + #![allow(warnings)] + include!(concat!(env!("OUT_DIR"), "/name/parser.rs")); +} use self::parser::NamesParser; use citeproc_io::Name; diff --git a/crates/texlab_citeproc/src/ris.rs b/crates/texlab_citeproc/src/ris.rs index 4a0379a69..716276ef4 100644 --- a/crates/texlab_citeproc/src/ris.rs +++ b/crates/texlab_citeproc/src/ris.rs @@ -226,8 +226,8 @@ impl RisLibrary { continue; } - let key: String = (&chars[..2]).into_iter().collect(); - let value: String = (&chars[6..]).into_iter().collect(); + let key: String = (&chars[..2]).iter().collect(); + let value: String = (&chars[6..]).iter().collect(); match key.to_uppercase().as_str() { "TY" => reference.ty = RisType::parse(&value), "A2" => reference.editors.push(value),