chore: Fix some violations of 'needless_pass_by_ref_mut' lint (#18795)
While this lint is allow-by-default, it seems pretty useful to get rid of mutable borrows when they're not needed. Closes #ISSUE Release Notes: - N/A
This commit is contained in:
parent
59f0f4ac42
commit
03c84466c2
36 changed files with 158 additions and 204 deletions
|
@ -107,7 +107,7 @@ impl Context for AsyncAppContext {
|
|||
|
||||
impl AsyncAppContext {
|
||||
/// Schedules all windows in the application to be redrawn.
|
||||
pub fn refresh(&mut self) -> Result<()> {
|
||||
pub fn refresh(&self) -> Result<()> {
|
||||
let app = self
|
||||
.app
|
||||
.upgrade()
|
||||
|
@ -205,7 +205,7 @@ impl AsyncAppContext {
|
|||
/// A convenience method for [AppContext::update_global]
|
||||
/// for updating the global state of the specified type.
|
||||
pub fn update_global<G: Global, R>(
|
||||
&mut self,
|
||||
&self,
|
||||
update: impl FnOnce(&mut G, &mut AppContext) -> R,
|
||||
) -> Result<R> {
|
||||
let app = self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue