Skip to content

Commit

Permalink
Update to edition 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Feb 1, 2020
1 parent 9d9e40c commit dfca673
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 29 deletions.
13 changes: 3 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
language: rust
rust:
- stable
before_script:
- pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH
script:
- travis-cargo build
- travis-cargo test
- travis-cargo doc
after_success:
- travis-cargo doc-upload
env:
global:
secure: FOH1fS4rH3js3BaoYUsFCIcr4ODpBXARpEbF+jpaRQyNS5Ch+NzLUz2Pj8gLbf6I1rGoF+mLANRbP6kfvwzZFa7/mSmiQ0Tfkm3HwDA623H35ocbbFjDNHd4ttP6Uu16M+KXm35hgj7C8iAUXCloX2KZOquB5UHbUVk65rPEtEU=
- cargo build
- cargo test
- cargo doc
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[package]

name = "open"
version = "1.3.2"
version = "1.3.3"
authors = ["Sebastian Thiel <[email protected]>"]
license = "MIT"
edition = "2018"
readme = "README.md"
description = "Open a path or URL using the program configured on the system"
repository = "https://github.com/Byron/open-rs"
keywords = ["open", "xdg-open", "start", "launch"]
documentation = "http://byron.github.io/open-rs"
exclude = ["/etc/*", "/.clog.toml", "/.travis.yml"]
include = ["src/**/*.rs", "Cargo.toml"]

[[bin]]
test = false
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ Add this to your Cargo.toml
[dependencies]
open = "*"
```

Add this to your lib ...
```Rust
extern crate open;
```

... and open something using
```Rust
open::that("https://rust-lang.org");
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<a name="v1.2.0"></a>
## v1.3.3 (2020-02-01)

* update code and crate to Edition 2018

## v1.2.0 (2017-01-31)

* **windows**: escape '&' in URLs. On windows, a shell is used to execute the command, which
Expand Down
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
#[cfg(windows)]
extern crate winapi;

#[cfg(not(target_os = "windows"))]
use std::process::{Command, Stdio};

use std::ffi::OsStr;
use std::io;
use std::process::ExitStatus;
use std::thread;
use std::{
ffi::OsStr,
process::{Command, Stdio},
io,
process::ExitStatus,
thread
};

#[cfg(not(any(target_os = "windows", target_os = "macos")))]
pub fn that<T: AsRef<OsStr> + Sized>(path: T) -> io::Result<ExitStatus> {
Expand Down
8 changes: 5 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
extern crate open;

use std::env;
use std::io::{stderr, Write};
use std::process;
use std::{
env,
io::{stderr, Write},
process
};

fn main() {
let path_or_url = match env::args().nth(1) {
Expand Down

0 comments on commit dfca673

Please sign in to comment.