qemu-display: replace needless Arc with Rc

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2024-04-09 18:54:57 +04:00
parent 9da1aa5aeb
commit 142148e8db
2 changed files with 8 additions and 8 deletions

View File

@ -2,7 +2,7 @@ use futures::stream::{self, StreamExt};
use std::{
collections::HashMap,
convert::{TryFrom, TryInto},
sync::Arc,
rc::Rc,
};
use zbus::{
fdo,
@ -31,7 +31,7 @@ struct Inner<'d> {
#[derive(Clone)]
pub struct Display<'d> {
inner: Arc<Inner<'d>>,
inner: Rc<Inner<'d>>,
}
impl<'d> Display<'d> {
@ -113,7 +113,7 @@ impl<'d> Display<'d> {
};
Ok(Self {
inner: Arc::new(inner),
inner: Rc::new(inner),
})
}

View File

@ -4,7 +4,7 @@ use glib::MainContext;
use gtk::{gio, glib, prelude::*};
use qemu_display::{util, Chardev, Console, Display};
use rdw::gtk;
use std::{cell::RefCell, convert::TryFrom, sync::Arc};
use std::{cell::RefCell, convert::TryFrom, rc::Rc};
use zbus::names::BusName;
mod audio;
@ -23,7 +23,7 @@ struct Inner {
#[derive(Clone)]
struct App {
inner: Arc<Inner>,
inner: Rc<Inner>,
}
#[derive(Debug, Default)]
@ -36,7 +36,7 @@ struct AppOptions {
wait: bool,
}
async fn display_from_opt(opt: Arc<RefCell<AppOptions>>) -> Option<Display<'static>> {
async fn display_from_opt(opt: Rc<RefCell<AppOptions>>) -> Option<Display<'static>> {
#[cfg(feature = "qmp")]
if let Some(qmp_addr) = &opt.borrow().qmp {
return Some(Display::new_qmp(qmp_addr).await.unwrap());
@ -145,7 +145,7 @@ impl App {
None,
);
let opt: Arc<RefCell<AppOptions>> = Default::default();
let opt: Rc<RefCell<AppOptions>> = Default::default();
let opt_clone = opt.clone();
app.connect_handle_local_options(move |_, opt| {
let mut app_opt = opt_clone.borrow_mut();
@ -173,7 +173,7 @@ impl App {
});
let app = App {
inner: Arc::new(Inner {
inner: Rc::new(Inner {
app,
#[cfg(unix)]
usbredir: Default::default(),