From 320f92c36a80bfafc5d57834592a7be5fd79f104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 8 Mar 2021 01:10:11 +0400 Subject: rust: fix cargo clippy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix clippy error about missing main(). Fix various clippy warnings "help: consider removing `'static`: `&str`" Run clippy with the rust test. Signed-off-by: Marc-André Lureau --- tools/keymap-gen | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/keymap-gen b/tools/keymap-gen index 4e2fafd..ac4b057 100755 --- a/tools/keymap-gen +++ b/tools/keymap-gen @@ -765,11 +765,11 @@ class RustLanguageGenerator(LanguageSrcGenerator): if fromtype == self.TYPE_ENUM: raise NotImplementedError("Enums not supported as source in Rust generator") - totypename = "&'static str" if totype == self.TYPE_STRING else "u16" + totypename = "&str" if totype == self.TYPE_STRING else "u16" if fromtype != self.TYPE_STRING: - print("pub static %s: &'static [%s] = &[" % (varname.upper(), totypename)) + print("pub static %s: &[%s] = &[" % (varname.upper(), totypename)) else: - print("pub static %s: phf::Map<&'static str, %s> = phf::phf_map! {" % + print("pub static %s: phf::Map<&str, %s> = phf::phf_map! {" % (varname.upper(), totypename)) def _array_end(self, fromtype, totype): -- cgit v1.1