Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dependencies in clipboard2 #6

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Security audit

on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
pull_request:

jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

65 changes: 65 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
on: [push, pull_request]

name: Rust

jobs:
check:
name: Check
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check

test:
name: Test Suite
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
command: test

clippy_check:
name: Clippy
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: clippy
override: true
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
name = "clipboard2"
version = "0.1.1"
authors = ["Avi Weinstock <[email protected]>", "Felix Schütt <[email protected]>"]
edition = "2021"
description = "clipboard2 is an improved version of clipboard-rs with better error handling and MIME type handling on Windows"
repository = "https://github.com/fschutt/clipboard2"
license = "MIT"
keywords = ["clipboard"]
readme = "README.md"

[target.'cfg(windows)'.dependencies]
clipboard-win = "2.0.0"
clipboard-win = "4.4"

[target.'cfg(target_os = "macos")'.dependencies]
objc = "0.2"
objc_id = "0.1"
objc-foundation = "0.1"

[target.'cfg(any(target_os = "linux", target_os = "openbsd"))'.dependencies]
x11-clipboard = "0.3.0-alpha.1"
x11-clipboard = "0.7"
10 changes: 6 additions & 4 deletions examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ extern crate clipboard2;
use clipboard2::{Clipboard, SystemClipboard};

fn main() {
let clipboard = SystemClipboard::new().unwrap();
clipboard.set_string_contents(String::from("Hello")).unwrap();
println!("{}", clipboard.get_string_contents().unwrap());
}
let clipboard = SystemClipboard::new().unwrap();
clipboard
.set_string_contents(String::from("Hello"))
.unwrap();
println!("{}", clipboard.get_string_contents().unwrap());
}
Loading