Skip to content

Commit bd4544d

Browse files
authored
fix(clipboard-manager): match Rust method parameters with native methods (#1379)
1 parent 381aed0 commit bd4544d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changes/clipboard-mobile.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"clipboard-manager": "patch"
3+
---
4+
5+
Fix reading and writing text on Android and iOS.

plugins/clipboard-manager/src/mobile.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl<R: Runtime> Clipboard<R> {
3737
pub fn write_text<'a, T: Into<Cow<'a, str>>>(&self, text: T) -> crate::Result<()> {
3838
let text = text.into().to_string();
3939
self.0
40-
.run_mobile_plugin("write", ClipKind::PlainText { text, label: None })
40+
.run_mobile_plugin("writeText", ClipKind::PlainText { text, label: None })
4141
.map_err(Into::into)
4242
}
4343

@@ -50,7 +50,7 @@ impl<R: Runtime> Clipboard<R> {
5050
let label = label.into().to_string();
5151
self.0
5252
.run_mobile_plugin(
53-
"write",
53+
"writeText",
5454
ClipKind::PlainText {
5555
text,
5656
label: Some(label),
@@ -67,7 +67,7 @@ impl<R: Runtime> Clipboard<R> {
6767

6868
pub fn read_text(&self) -> crate::Result<String> {
6969
self.0
70-
.run_mobile_plugin("read", ())
70+
.run_mobile_plugin("readText", ())
7171
.map(|c| match c {
7272
ClipboardContents::PlainText { text } => text,
7373
})

0 commit comments

Comments
 (0)