Skip to content

Commit 6cd8159

Browse files
Merge branch 'GraphiteEditor:master' into closing-doc-tabs
2 parents d49660c + 4c10afe commit 6cd8159

File tree

2 files changed

+33
-20
lines changed

2 files changed

+33
-20
lines changed

client/web/package-lock.json

Lines changed: 20 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/editor/src/input/input_mapper.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct MappingEntry {
2121
action: Message,
2222
}
2323

24-
#[derive(Debug, Clone, Default)]
24+
#[derive(Debug, Clone)]
2525
struct KeyMappingEntries(Vec<MappingEntry>);
2626

2727
impl KeyMappingEntries {
@@ -38,12 +38,19 @@ impl KeyMappingEntries {
3838
self.0.push(entry)
3939
}
4040

41+
const fn new() -> Self {
42+
Self(Vec::new())
43+
}
44+
4145
fn key_array() -> [Self; NUMBER_OF_KEYS] {
42-
let mut array: [KeyMappingEntries; NUMBER_OF_KEYS] = unsafe { std::mem::zeroed() };
43-
for key in array.iter_mut() {
44-
*key = KeyMappingEntries::default();
45-
}
46-
array
46+
const DEFAULT: KeyMappingEntries = KeyMappingEntries::new();
47+
[DEFAULT; NUMBER_OF_KEYS]
48+
}
49+
}
50+
51+
impl Default for KeyMappingEntries {
52+
fn default() -> Self {
53+
Self::new()
4754
}
4855
}
4956

0 commit comments

Comments
 (0)