mirror of
https://github.com/servo/servo.git
synced 2025-08-02 04:00:32 +01:00
Remove get_
prefix on getters
Part of #6224 I certainly didn't remove all of them; I avoided `unsafe` areas and also `components/script`
This commit is contained in:
parent
c63fc4dc13
commit
435e551753
21 changed files with 62 additions and 70 deletions
|
@ -10,13 +10,13 @@ use std::sync::mpsc::channel;
|
|||
|
||||
pub trait ClipboardProvider {
|
||||
// blocking method to get the clipboard contents
|
||||
fn get_clipboard_contents(&mut self) -> String;
|
||||
fn clipboard_contents(&mut self) -> String;
|
||||
// blocking method to set the clipboard contents
|
||||
fn set_clipboard_contents(&mut self, &str);
|
||||
}
|
||||
|
||||
impl ClipboardProvider for ConstellationChan {
|
||||
fn get_clipboard_contents(&mut self) -> String {
|
||||
fn clipboard_contents(&mut self) -> String {
|
||||
let (tx, rx) = channel();
|
||||
self.0.send(ConstellationMsg::GetClipboardContents(tx)).unwrap();
|
||||
rx.recv().unwrap()
|
||||
|
@ -39,7 +39,7 @@ impl DummyClipboardContext {
|
|||
}
|
||||
|
||||
impl ClipboardProvider for DummyClipboardContext {
|
||||
fn get_clipboard_contents(&mut self) -> String {
|
||||
fn clipboard_contents(&mut self) -> String {
|
||||
self.content.clone()
|
||||
}
|
||||
fn set_clipboard_contents(&mut self, s: &str) {
|
||||
|
|
|
@ -315,7 +315,7 @@ impl<T: ClipboardProvider> TextInput<T> {
|
|||
KeyReaction::Nothing
|
||||
},
|
||||
Key::V if is_control_key(mods) => {
|
||||
let contents = self.clipboard_provider.get_clipboard_contents();
|
||||
let contents = self.clipboard_provider.clipboard_contents();
|
||||
self.insert_string(&contents);
|
||||
KeyReaction::DispatchInput
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue