diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2021-03-08 01:10:11 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2021-03-08 01:10:33 +0400 |
commit | 320f92c36a80bfafc5d57834592a7be5fd79f104 (patch) | |
tree | 8ec159ed36aa9f91aa91e215e2497a041ec3b99b /tools | |
parent | e62d42f0fd76f7bb8bf78385a83c060e66ff52b0 (diff) | |
download | keycodemapdb-320f92c36a80bfafc5d57834592a7be5fd79f104.zip keycodemapdb-320f92c36a80bfafc5d57834592a7be5fd79f104.tar.gz keycodemapdb-320f92c36a80bfafc5d57834592a7be5fd79f104.tar.bz2 |
rust: fix cargo clippy
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 <marcandre.lureau@redhat.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/keymap-gen | 6 |
1 files changed, 3 insertions, 3 deletions
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): |