Skip to content

Commit 3dbcbe7

Browse files
authored
fix(tauri): Webview::navigate unnecessarily borrows &mut self (#12461)
1 parent a2d36b8 commit 3dbcbe7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri': 'minor:bug'
3+
---
4+
5+
`Webview::navigate` and `WebviewWindow::navigate` borrows `&self` instead of unnecessarily borrowing `&mut self`.

crates/tauri/src/webview/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ fn main() {
12841284
}
12851285

12861286
/// Navigates the webview to the defined url.
1287-
pub fn navigate(&mut self, url: Url) -> crate::Result<()> {
1287+
pub fn navigate(&self, url: Url) -> crate::Result<()> {
12881288
self.webview.dispatcher.navigate(url).map_err(Into::into)
12891289
}
12901290

crates/tauri/src/webview/webview_window.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1883,7 +1883,7 @@ impl<R: Runtime> WebviewWindow<R> {
18831883
}
18841884

18851885
/// Navigates the webview to the defined url.
1886-
pub fn navigate(&mut self, url: Url) -> crate::Result<()> {
1886+
pub fn navigate(&self, url: Url) -> crate::Result<()> {
18871887
self.webview.navigate(url)
18881888
}
18891889

0 commit comments

Comments
 (0)