Skip to content

Commit

Permalink
Format imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ids1024 committed Apr 24, 2024
1 parent 76daf6e commit ee1d54a
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 34 deletions.
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imports_granularity = "Crate"
2 changes: 1 addition & 1 deletion src/backend/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl AppData {
}
}

fn start(conn: Connection) -> mpsc::Receiver<Event> {
fn start(_conn: Connection) -> mpsc::Receiver<Event> {
let (sender, receiver) = mpsc::channel(20);
thread::spawn(move || {
let mut event_loop = calloop::EventLoop::try_new().unwrap();
Expand Down
10 changes: 5 additions & 5 deletions src/backend/wayland/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ use cctk::{
Connection, Dispatch, QueueHandle,
},
};
use cosmic::cctk;
use cosmic::iced_sctk::subsurface_widget::{BufferSource, Dmabuf, Plane, Shmbuf};
use rustix::{io::Errno, shm::ShmOFlags};
use cosmic::{
cctk,
iced_sctk::subsurface_widget::{BufferSource, Dmabuf, Plane, Shmbuf},
};
use std::{
os::fd::{AsFd, OwnedFd},
os::fd::AsFd,
path::{Path, PathBuf},
sync::Arc,
time::{SystemTime, UNIX_EPOCH},
};
use wayland_protocols::wp::linux_dmabuf::zv1::client::zwp_linux_buffer_params_v1;

Expand Down
10 changes: 6 additions & 4 deletions src/backend/wayland/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ use cctk::{
},
workspace::WorkspaceState,
};
use cosmic::cctk;
use cosmic::iced::{
self,
futures::{executor::block_on, FutureExt, SinkExt},
use cosmic::{
cctk,
iced::{
self,
futures::{executor::block_on, FutureExt, SinkExt},
},
};
use futures_channel::mpsc;
use std::{cell::RefCell, collections::HashMap, fs, path::PathBuf, sync::Arc, thread};
Expand Down
23 changes: 13 additions & 10 deletions src/backend/wayland/screencopy.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
use cosmic::cctk::{
self,
cosmic_protocols::screencopy::v2::client::{
zcosmic_screencopy_frame_v2, zcosmic_screencopy_manager_v2, zcosmic_screencopy_session_v2,
use cosmic::{
cctk::{
self,
cosmic_protocols::screencopy::v2::client::{
zcosmic_screencopy_frame_v2, zcosmic_screencopy_manager_v2,
zcosmic_screencopy_session_v2,
},
screencopy::{
capture, Formats, Frame, ScreencopyFrameData, ScreencopyFrameDataExt,
ScreencopyHandler, ScreencopySessionData, ScreencopySessionDataExt, ScreencopyState,
},
wayland_client::{Connection, Proxy, QueueHandle, WEnum},
},
screencopy::{
capture, Formats, Frame, ScreencopyFrameData, ScreencopyFrameDataExt, ScreencopyHandler,
ScreencopySessionData, ScreencopySessionDataExt, ScreencopyState,
},
wayland_client::{Connection, Proxy, QueueHandle, WEnum},
iced_sctk::subsurface_widget::{SubsurfaceBuffer, SubsurfaceBufferRelease},
};
use cosmic::iced_sctk::subsurface_widget::{SubsurfaceBuffer, SubsurfaceBufferRelease};
use std::{
array,
sync::{Arc, Weak},
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,8 @@ impl Application for App {
}
Msg::StartDrag(size, drag_surface) => {
let (output, mime_type) = match &drag_surface {
DragSurface::Workspace { handle, output } => (output, &*WORKSPACE_MIME),
DragSurface::Toplevel { handle, output } => (output, &*TOPLEVEL_MIME),
DragSurface::Workspace { handle: _, output } => (output, &*WORKSPACE_MIME),
DragSurface::Toplevel { handle: _, output } => (output, &*TOPLEVEL_MIME),
};
let id = SurfaceId::unique();
if let Some((parent_id, _)) = self
Expand Down
22 changes: 12 additions & 10 deletions src/widgets/image_bg.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
// Renders image behind widget, and otherwise passes through all behavior

use cosmic::iced::{
advanced::{
layout::{self},
mouse, overlay, renderer,
widget::{tree, Operation, OperationOutputWrapper, Tree},
Clipboard, Layout, Shell, Widget,
use cosmic::{
iced::{
advanced::{
layout::{self},
mouse, overlay, renderer,
widget::{tree, Operation, OperationOutputWrapper, Tree},
Clipboard, Layout, Shell, Widget,
},
event::{self, Event},
widget::image::{FilterMethod, Handle},
ContentFit, Length, Rectangle, Size, Vector,
},
event::{self, Event},
widget::image::{FilterMethod, Handle},
ContentFit, Length, Rectangle, Size, Vector,
iced_core::Renderer,
};
use cosmic::iced_core::Renderer;

use std::marker::PhantomData;

Expand Down
4 changes: 2 additions & 2 deletions src/widgets/visibility_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use cosmic::iced::{
advanced::{
layout, mouse, overlay, renderer,
widget::{tree, Id, Operation, OperationOutputWrapper, Tree},
layout, mouse, renderer,
widget::{Operation, OperationOutputWrapper, Tree},
Clipboard, Layout, Shell, Widget,
},
event::{self, Event},
Expand Down

0 comments on commit ee1d54a

Please sign in to comment.