Update rust version (required many build changes)
This commit is contained in:
+6
-7
@@ -209,10 +209,9 @@ impl ApplicationHandler<UserEvent> for Application {
|
||||
.focused
|
||||
.as_ref()
|
||||
.and_then(|id| self.viewports.get_mut(id))
|
||||
&& viewport.app.handle_gamepad_event(&event)
|
||||
{
|
||||
if viewport.app.handle_gamepad_event(&event) {
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
self.controllers.handle_gamepad_event(&event);
|
||||
}
|
||||
@@ -289,10 +288,10 @@ impl ApplicationHandler<UserEvent> for Application {
|
||||
|
||||
fn exiting(&mut self, _event_loop: &ActiveEventLoop) {
|
||||
let (sender, receiver) = oneshot::channel();
|
||||
if self.client.send_command(EmulatorCommand::Exit(sender)) {
|
||||
if let Err(error) = receiver.recv_timeout(Duration::from_secs(5)) {
|
||||
error!(%error, "could not gracefully exit.");
|
||||
}
|
||||
if self.client.send_command(EmulatorCommand::Exit(sender))
|
||||
&& let Err(error) = receiver.recv_timeout(Duration::from_secs(5))
|
||||
{
|
||||
error!(%error, "could not gracefully exit.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -455,11 +455,11 @@ impl Emulator {
|
||||
let Some(sim) = self.sims.get_mut(sim_id.to_index()) else {
|
||||
return true;
|
||||
};
|
||||
if let Some(text) = sim.take_stdout() {
|
||||
if stdout.send(text).is_err() {
|
||||
sim.watch_stdout(false);
|
||||
return false;
|
||||
}
|
||||
if let Some(text) = sim.take_stdout()
|
||||
&& stdout.send(text).is_err()
|
||||
{
|
||||
sim.watch_stdout(false);
|
||||
return false;
|
||||
}
|
||||
true
|
||||
});
|
||||
|
||||
+1
-1
@@ -169,7 +169,7 @@ impl MemoryRef<'_> {
|
||||
T::from_bytes(&self.inner[from..to])
|
||||
}
|
||||
|
||||
pub fn range<T: MemoryValue>(&self, start: usize, count: usize) -> MemoryIter<T> {
|
||||
pub fn range<T: MemoryValue>(&self, start: usize, count: usize) -> MemoryIter<'_, T> {
|
||||
let from = start * size_of::<T>();
|
||||
let to = from + (count * size_of::<T>());
|
||||
MemoryIter::new(&self.inner[from..to])
|
||||
|
||||
+1
-1
@@ -457,7 +457,7 @@ impl GameWindow {
|
||||
self.config = new_config;
|
||||
}
|
||||
|
||||
fn button_for(&self, ctx: &Context, text: &str, command: Command) -> Button {
|
||||
fn button_for(&self, ctx: &Context, text: &str, command: Command) -> Button<'_> {
|
||||
let button = Button::new(text);
|
||||
match self.shortcuts.shortcut_for(command) {
|
||||
Some(shortcut) => button.shortcut_text(ctx.format_shortcut(&shortcut)),
|
||||
|
||||
@@ -62,8 +62,8 @@ impl HotkeysWindow {
|
||||
}
|
||||
});
|
||||
});
|
||||
if let Some(command) = self.now_binding {
|
||||
if let Some(shortcut) = ui.input_mut(|i| {
|
||||
if let Some(command) = self.now_binding
|
||||
&& let Some(shortcut) = ui.input_mut(|i| {
|
||||
i.events.iter().find_map(|event| match event {
|
||||
Event::Key {
|
||||
key,
|
||||
@@ -73,10 +73,10 @@ impl HotkeysWindow {
|
||||
} => Some(KeyboardShortcut::new(*modifiers, *key)),
|
||||
_ => None,
|
||||
})
|
||||
}) {
|
||||
self.shortcuts.set(command, shortcut);
|
||||
self.now_binding = None;
|
||||
}
|
||||
})
|
||||
{
|
||||
self.shortcuts.set(command, shortcut);
|
||||
self.now_binding = None;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -86,10 +86,10 @@ impl UiExt for Ui {
|
||||
let (rect, _) = ui.allocate_at_least(Vec2::new(100.0, 100.0), Sense::hover());
|
||||
ui.painter().rect_filled(rect, 0.0, *color);
|
||||
let resp = ui.text_edit_singleline(hex);
|
||||
if resp.changed() {
|
||||
if let Ok(new_color) = HexColor::from_str_without_hash(hex) {
|
||||
*color = new_color.color();
|
||||
}
|
||||
if resp.changed()
|
||||
&& let Ok(new_color) = HexColor::from_str_without_hash(hex)
|
||||
{
|
||||
*color = new_color.color();
|
||||
}
|
||||
resp
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user