mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Remove unused Arc<RwLock<T>>
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
use std::sync::{Arc, RwLock};
|
|
||||||
|
|
||||||
/// How often we repaint the demo app by default
|
/// How often we repaint the demo app by default
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||||
enum RunMode {
|
enum RunMode {
|
||||||
@@ -356,7 +354,7 @@ struct EguiWindows {
|
|||||||
output_events: bool,
|
output_events: bool,
|
||||||
|
|
||||||
#[cfg_attr(feature = "serde", serde(skip))]
|
#[cfg_attr(feature = "serde", serde(skip))]
|
||||||
output_event_history: Arc<RwLock<std::collections::VecDeque<egui::output::OutputEvent>>>,
|
output_event_history: std::collections::VecDeque<egui::output::OutputEvent>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for EguiWindows {
|
impl Default for EguiWindows {
|
||||||
@@ -401,7 +399,6 @@ impl EguiWindows {
|
|||||||
} = self;
|
} = self;
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut output_event_history = output_event_history.write().unwrap();
|
|
||||||
ctx.output(|o| {
|
ctx.output(|o| {
|
||||||
for event in &o.events {
|
for event in &o.events {
|
||||||
output_event_history.push_back(event.clone());
|
output_event_history.push_back(event.clone());
|
||||||
@@ -453,7 +450,7 @@ impl EguiWindows {
|
|||||||
egui::ScrollArea::vertical()
|
egui::ScrollArea::vertical()
|
||||||
.stick_to_bottom(true)
|
.stick_to_bottom(true)
|
||||||
.show(ui, |ui| {
|
.show(ui, |ui| {
|
||||||
for event in output_event_history.read() {
|
for event in output_event_history {
|
||||||
ui.label(format!("{event:?}"));
|
ui.label(format!("{event:?}"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user