Skip to content

Commit

Permalink
Run cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ratijas committed Apr 22, 2021
1 parent f25dac0 commit da57a01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
10 changes: 3 additions & 7 deletions qmetaobject/src/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use std::task::{Context, Poll, RawWaker, RawWakerVTable, Waker};

use crate::connections::SignalArgArrayToTuple;


static QT_WAKER_VTABLE: RawWakerVTable = RawWakerVTable::new(
|s: *const ()| {
RawWaker::new(
Expand Down Expand Up @@ -63,7 +62,7 @@ cpp! {{
}
completed = rust!(ProcessQtEvent [
this: *const () as "Waker *",
future: *mut dyn Future<Output=()> as "TraitObject"
future: *mut dyn Future<Output = ()> as "TraitObject"
] -> bool as "bool" {
poll_with_qt_waker(this, Pin::new_unchecked(&mut *future))
});
Expand All @@ -90,7 +89,7 @@ cpp! {{
}

~Waker() {
rust!(QtDestroyFuture [future: *mut dyn Future<Output=()> as "TraitObject"] {
rust!(QtDestroyFuture [future: *mut dyn Future<Output = ()> as "TraitObject"] {
std::mem::drop(Box::from_raw(future))
});
}
Expand Down Expand Up @@ -159,10 +158,7 @@ pub unsafe fn wait_on_signal<Args: SignalArgArrayToTuple>(

impl<Args: SignalArgArrayToTuple> Future for ConnectionFuture<Args> {
type Output = <Args as SignalArgArrayToTuple>::Tuple;
fn poll(
mut self: Pin<&mut Self>,
ctx: &mut Context,
) -> Poll<Self::Output> {
fn poll(mut self: Pin<&mut Self>, ctx: &mut Context) -> Poll<Self::Output> {
let state = &mut self.0;
*state = match std::mem::replace(state, ConnectionFutureState::Invalid) {
ConnectionFutureState::Finished { result } => {
Expand Down
3 changes: 1 addition & 2 deletions qmetaobject/src/itemmodel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ pub trait QAbstractItemModel: QObject {
/// Refer to the Qt documentation of QAbstractListModel::layoutAboutToBeChanged
///
/// update_model_indexes need to be called between layout_about_to_be_changed and layout_changed
fn update_model_indexes(&self, f: &mut dyn FnMut(QModelIndex) -> QModelIndex)
{
fn update_model_indexes(&self, f: &mut dyn FnMut(QModelIndex) -> QModelIndex) {
let obj = self.get_cpp_object();
cpp!(unsafe [obj as "Rust_QAbstractItemModel *", f as "TraitObject"] {
if (!obj) return;
Expand Down

0 comments on commit da57a01

Please sign in to comment.