mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-21 11:26:15 +02:00
fix(clipboard-manager): match Rust method parameters with native methods (#1379)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"clipboard-manager": "patch"
|
||||
---
|
||||
|
||||
Fix reading and writing text on Android and iOS.
|
||||
@@ -37,7 +37,7 @@ impl<R: Runtime> Clipboard<R> {
|
||||
pub fn write_text<'a, T: Into<Cow<'a, str>>>(&self, text: T) -> crate::Result<()> {
|
||||
let text = text.into().to_string();
|
||||
self.0
|
||||
.run_mobile_plugin("write", ClipKind::PlainText { text, label: None })
|
||||
.run_mobile_plugin("writeText", ClipKind::PlainText { text, label: None })
|
||||
.map_err(Into::into)
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ impl<R: Runtime> Clipboard<R> {
|
||||
let label = label.into().to_string();
|
||||
self.0
|
||||
.run_mobile_plugin(
|
||||
"write",
|
||||
"writeText",
|
||||
ClipKind::PlainText {
|
||||
text,
|
||||
label: Some(label),
|
||||
@@ -67,7 +67,7 @@ impl<R: Runtime> Clipboard<R> {
|
||||
|
||||
pub fn read_text(&self) -> crate::Result<String> {
|
||||
self.0
|
||||
.run_mobile_plugin("read", ())
|
||||
.run_mobile_plugin("readText", ())
|
||||
.map(|c| match c {
|
||||
ClipboardContents::PlainText { text } => text,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user