Skip to content

Commit

Permalink
Update to the io-lifetimes impl AsFd for &T support.
Browse files Browse the repository at this point in the history
Update to io-lifetimes 0.5.2 and `impl AsFd for &T` support added in
rust-lang/rust#93888 and sunfishcode/io-lifetimes#18.
  • Loading branch information
sunfishcode committed Feb 17, 2022
1 parent f2fc83c commit 0a37af5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/sunfishcode/io-extras"
exclude = ["/.github"]

[dependencies]
io-lifetimes = { version = "0.5.1", default-features = false }
io-lifetimes = { version = "0.5.2", default-features = false }

# Optionally depend on async-std to implement traits for its types.
#
Expand Down
14 changes: 7 additions & 7 deletions tests/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ fn read_write() {

struct Stream {}
impl Stream {
fn use_socket<Socketlike: io_lifetimes::AsSocketlike>(_socketlike: &mut Socketlike) {}
fn use_socket<Socketlike: io_lifetimes::AsSocketlike>(_socketlike: Socketlike) {}

fn use_file<Filelike: io_lifetimes::AsFilelike>(_filelike: &mut Filelike) {}
fn use_file<Filelike: io_lifetimes::AsFilelike>(_filelike: Filelike) {}

fn use_grip<Grip: io_extras::grip::AsGrip>(_grip: &mut Grip) {}
fn use_grip<Grip: io_extras::grip::AsGrip>(_grip: Grip) {}

fn from_socket<Socketlike: io_lifetimes::IntoSocketlike>(_socketlike: Socketlike) {}

Expand All @@ -78,10 +78,10 @@ impl Stream {

#[test]
fn likes() {
let _ = Stream::use_socket(&mut std::net::TcpListener::bind("127.0.0.1:0").unwrap());
let _ = Stream::use_file(&mut std::fs::File::open("Cargo.toml").unwrap());
let _ = Stream::use_grip(&mut std::net::TcpListener::bind("127.0.0.1:0").unwrap());
let _ = Stream::use_grip(&mut std::fs::File::open("Cargo.toml").unwrap());
let _ = Stream::use_socket(std::net::TcpListener::bind("127.0.0.1:0").unwrap());
let _ = Stream::use_file(std::fs::File::open("Cargo.toml").unwrap());
let _ = Stream::use_grip(std::net::TcpListener::bind("127.0.0.1:0").unwrap());
let _ = Stream::use_grip(std::fs::File::open("Cargo.toml").unwrap());

let _ = Stream::from_socket(std::net::TcpListener::bind("127.0.0.1:0").unwrap());
let _ = Stream::from_file(std::fs::File::open("Cargo.toml").unwrap());
Expand Down

0 comments on commit 0a37af5

Please sign in to comment.