mirror of
https://github.com/icewind1991/clipboard-sync
synced 2026-06-03 18:34:07 +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"
|
name = "clipboard-sync"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Robin Appelman <robin@icewind.nl>"]
|
authors = ["Robin Appelman <robin@icewind.nl>"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "server"
|
name = "server"
|
||||||
|
|
@ -12,14 +13,9 @@ name = "client"
|
||||||
path = "src/client.rs"
|
path = "src/client.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
mio = "0.6.15"
|
mio = "0.6"
|
||||||
serde = "1.0.70"
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0.24"
|
serde_json = "1.0"
|
||||||
serde_derive = "1.0.70"
|
clipboard = "0.5"
|
||||||
clipboard = "0.4.6"
|
env_logger = "0.6"
|
||||||
env_logger = "0.5.11"
|
ws = {version = "0.8", features = ["native-tls"]}
|
||||||
|
|
||||||
# nativetls support is currently no released yet, will be 0.7.7
|
|
||||||
[dependencies.ws]
|
|
||||||
git = "https://github.com/housleyjk/ws-rs"
|
|
||||||
features = ["nativetls"]
|
|
||||||
|
|
|
||||||
|
|
@ -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 clipboard::{ClipboardContext, ClipboardProvider};
|
||||||
use common::ClipboardCommand;
|
use crate::common::ClipboardCommand;
|
||||||
use std::{thread, thread::JoinHandle, time};
|
use std::{thread, thread::JoinHandle, time};
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
use serde::{Serialize, Deserialize};
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
#[serde(tag = "type")]
|
#[serde(tag = "type")]
|
||||||
pub enum ClipboardCommand {
|
pub enum ClipboardCommand {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,4 @@
|
||||||
extern crate mio;
|
use crate::common::ClipboardCommand;
|
||||||
extern crate serde;
|
|
||||||
#[macro_use] extern crate serde_derive;
|
|
||||||
extern crate serde_json;
|
|
||||||
extern crate ws;
|
|
||||||
|
|
||||||
use common::ClipboardCommand;
|
|
||||||
use mio::Token;
|
use mio::Token;
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
@ -27,7 +21,7 @@ fn handle_command(command: ClipboardCommand, sessions: &mut HashMap<String, Sess
|
||||||
|
|
||||||
ClipboardCommand::Set { value, session: session_name } => {
|
ClipboardCommand::Set { value, session: session_name } => {
|
||||||
match sessions.get_mut(&session_name) {
|
match sessions.get_mut(&session_name) {
|
||||||
Some(mut session) => {
|
Some(session) => {
|
||||||
send_to_session(session, &ClipboardCommand::Set {
|
send_to_session(session, &ClipboardCommand::Set {
|
||||||
value,
|
value,
|
||||||
session: session_name,
|
session: session_name,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue