mirror of
https://github.com/icewind1991/clipboard-sync
synced 2026-06-03 10:24:06 +02:00
update dependencies and edition
This commit is contained in:
parent
68566144f0
commit
7a0665eae9
5 changed files with 459 additions and 317 deletions
740
Cargo.lock
generated
740
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
18
Cargo.toml
18
Cargo.toml
|
|
@ -2,6 +2,7 @@
|
|||
name = "clipboard-sync"
|
||||
version = "0.1.0"
|
||||
authors = ["Robin Appelman <robin@icewind.nl>"]
|
||||
edition = "2018"
|
||||
|
||||
[[bin]]
|
||||
name = "server"
|
||||
|
|
@ -12,14 +13,9 @@ name = "client"
|
|||
path = "src/client.rs"
|
||||
|
||||
[dependencies]
|
||||
mio = "0.6.15"
|
||||
serde = "1.0.70"
|
||||
serde_json = "1.0.24"
|
||||
serde_derive = "1.0.70"
|
||||
clipboard = "0.4.6"
|
||||
env_logger = "0.5.11"
|
||||
|
||||
# nativetls support is currently no released yet, will be 0.7.7
|
||||
[dependencies.ws]
|
||||
git = "https://github.com/housleyjk/ws-rs"
|
||||
features = ["nativetls"]
|
||||
mio = "0.6"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
clipboard = "0.5"
|
||||
env_logger = "0.6"
|
||||
ws = {version = "0.8", features = ["native-tls"]}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,5 @@
|
|||
extern crate clipboard;
|
||||
extern crate env_logger;
|
||||
extern crate serde;
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
extern crate serde_json;
|
||||
extern crate ws;
|
||||
|
||||
use clipboard::{ClipboardContext, ClipboardProvider};
|
||||
use common::ClipboardCommand;
|
||||
use crate::common::ClipboardCommand;
|
||||
use std::{thread, thread::JoinHandle, time};
|
||||
use std::env;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
use serde::{Serialize, Deserialize};
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum ClipboardCommand {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,4 @@
|
|||
extern crate mio;
|
||||
extern crate serde;
|
||||
#[macro_use] extern crate serde_derive;
|
||||
extern crate serde_json;
|
||||
extern crate ws;
|
||||
|
||||
use common::ClipboardCommand;
|
||||
use crate::common::ClipboardCommand;
|
||||
use mio::Token;
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
|
|
@ -27,7 +21,7 @@ fn handle_command(command: ClipboardCommand, sessions: &mut HashMap<String, Sess
|
|||
|
||||
ClipboardCommand::Set { value, session: session_name } => {
|
||||
match sessions.get_mut(&session_name) {
|
||||
Some(mut session) => {
|
||||
Some(session) => {
|
||||
send_to_session(session, &ClipboardCommand::Set {
|
||||
value,
|
||||
session: session_name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue