Skip to content

Commit

Permalink
Remove some now-unnecessary &muts
Browse files Browse the repository at this point in the history
  • Loading branch information
YaLTeR committed Oct 29, 2023
1 parent 5e543b8 commit 27e2648
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/niri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ impl Niri {
}

pub fn pointer_element(
&mut self,
&self,
renderer: &mut GlesRenderer,
output: &Output,
) -> Vec<OutputRenderElements<GlesRenderer>> {
Expand Down Expand Up @@ -1224,7 +1224,7 @@ impl Niri {
}

fn render(
&mut self,
&self,
renderer: &mut GlesRenderer,
output: &Output,
include_pointer: bool,
Expand All @@ -1241,7 +1241,7 @@ impl Niri {

// If the session is locked, draw the lock surface.
if self.is_locked() {
let state = self.output_state.get_mut(output).unwrap();
let state = self.output_state.get(output).unwrap();
if let Some(surface) = state.lock_surface.as_ref() {
elements.extend(render_elements_from_surface_tree(
renderer,
Expand Down Expand Up @@ -1808,11 +1808,7 @@ impl Niri {
}
}

pub fn screenshot(
&mut self,
renderer: &mut GlesRenderer,
output: &Output,
) -> anyhow::Result<()> {
pub fn screenshot(&self, renderer: &mut GlesRenderer, output: &Output) -> anyhow::Result<()> {
let _span = tracy_client::span!("Niri::screenshot");

let size = output.current_mode().unwrap().size;
Expand All @@ -1825,7 +1821,7 @@ impl Niri {
}

pub fn screenshot_window(
&mut self,
&self,
renderer: &mut GlesRenderer,
output: &Output,
window: &Window,
Expand All @@ -1849,11 +1845,7 @@ impl Niri {
.context("error saving screenshot")
}

fn save_screenshot(
&mut self,
size: Size<i32, Physical>,
pixels: Vec<u8>,
) -> anyhow::Result<()> {
fn save_screenshot(&self, size: Size<i32, Physical>, pixels: Vec<u8>) -> anyhow::Result<()> {
let path = make_screenshot_path().context("error making screenshot path")?;
debug!("saving screenshot to {path:?}");

Expand Down Expand Up @@ -1903,7 +1895,7 @@ impl Niri {

#[cfg(feature = "dbus")]
pub fn screenshot_all_outputs(
&mut self,
&self,
renderer: &mut GlesRenderer,
include_pointer: bool,
on_done: impl FnOnce(PathBuf) + Send + 'static,
Expand Down

0 comments on commit 27e2648

Please sign in to comment.