diff --git a/Cargo.lock b/Cargo.lock index 043db33..216f7d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -58,9 +58,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bumpalo" @@ -447,7 +447,7 @@ dependencies = [ [[package]] name = "mio" version = "0.8.8" -source = "git+https://github.com/vita-rust/mio?branch=vita#df7a1c3cbfd9aa952fa619f61d806603a2be9e8f" +source = "git+https://github.com/vita-rust/mio?branch=vita#099c9c8da9554e80744b23a49c915631a8fe4672" dependencies = [ "libc", "wasi", @@ -493,7 +493,7 @@ version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "cfg-if", "foreign-types", "libc", @@ -533,15 +533,14 @@ dependencies = [ [[package]] name = "oxhttp" -version = "0.1.7" +version = "0.2.0-alpha.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64f8f4b616372a7e657a05100d1389325fc2f7d3fee5c9de05166d979cb2b729" +checksum = "525e4922eaf3a36d3d8534226910b6f5b878446d2f7f20b31da7889eb969f984" dependencies = [ "httparse", - "lazy_static", "rustls", - "rustls-native-certs", "url", + "webpki-roots", ] [[package]] @@ -701,7 +700,7 @@ version = "0.38.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", @@ -720,18 +719,6 @@ dependencies = [ "sct", ] -[[package]] -name = "rustls-native-certs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" -dependencies = [ - "openssl-probe", - "rustls-pemfile", - "schannel", - "security-framework", -] - [[package]] name = "rustls-pemfile" version = "1.0.3" @@ -878,7 +865,7 @@ dependencies = [ [[package]] name = "socket2" version = "0.4.9" -source = "git+https://github.com/vita-rust/socket2?branch=v0.4.9-vita#12c617dca2bd0017f2831afd5c6fc89459c76ed7" +source = "git+https://github.com/rust-lang/socket2?branch=v0.4.x#03211da88f443ef2cb2d30e818a9a04b0d4e7175" dependencies = [ "libc", "winapi", @@ -887,7 +874,7 @@ dependencies = [ [[package]] name = "socket2" version = "0.5.4" -source = "git+https://github.com/vita-rust/socket2?branch=v0.5.3-vita#187fe7d56f684b36efd2c939e300df50143270c5" +source = "git+https://github.com/rust-lang/socket2?branch=master#f61a788b887c4bad8b2333fed883d5a4ff16d3b5" dependencies = [ "libc", "windows-sys", @@ -1138,9 +1125,9 @@ dependencies = [ [[package]] name = "vita-newlib-shims" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1b65be24403a23b53e05c4f667c59a95f83f60d4826784fc09636af29a6565" +checksum = "bd3fec9c91703355d84c06e70b848171368912901cea077260a6361e1c22a170" dependencies = [ "libc", ] diff --git a/Cargo.toml b/Cargo.toml index 5df8928..856381c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,9 @@ opt-level = 2 [patch.crates-io] mio = { git = "https://github.com/vita-rust/mio", branch = "vita" } tokio = { git = "https://github.com/vita-rust/tokio", branch = "vita" } -socket2053 = { git = "https://github.com/vita-rust/socket2", branch = "v0.5.3-vita", package = "socket2", version = "0.5.3" } -socket2049 = { git = "https://github.com/vita-rust/socket2", branch = "v0.4.9-vita", package = "socket2", version = "0.4.9" } + +socket2053 = { git = "https://github.com/rust-lang/socket2", branch = "master", package = "socket2", version = "0.5.3" } +socket2049 = { git = "https://github.com/rust-lang/socket2", branch = "v0.4.x", package = "socket2", version = "0.4.9" } # Required for rustls ring = { git = "https://github.com/vita-rust/ring", branch = "v0.16.20-vita" } diff --git a/crates/2-http-client/Cargo.toml b/crates/2-http-client/Cargo.toml index 9a6a668..6105123 100644 --- a/crates/2-http-client/Cargo.toml +++ b/crates/2-http-client/Cargo.toml @@ -8,8 +8,7 @@ repository = "https://github.com/vita-rust/examples" homepage = "https://github.com/vita-rust/examples/crates/2-http-client" [features] -default = ["rustls", "shims"] -shims = ["vita-newlib-shims"] +default = ["rustls"] rustls = ["reqwest/rustls-tls", "oxhttp/rustls"] openssl = ["reqwest/native-tls"] @@ -18,9 +17,9 @@ anyhow = "1.0" libc = "0.2.149" reqwest = { version = "0.11", default-features = false, features = ["json"] } tokio = { version = "1", features = ["macros", "rt", "net"] } -oxhttp = { version = "0.1.7", features = ["rustls"] } +oxhttp = { version = "0.2.0-alpha.1", features = ["rustls", "webpki-roots"] } ureq = { version = "2.7.1", default-features = false, features = ["gzip"] } -vita-newlib-shims = { version = "0.2", optional = true } +vita-newlib-shims = { version = "0.3", features = ["fcntl"] } [package.metadata.vita] title_id = "RUSTTEST2" diff --git a/crates/2-http-client/src/main.rs b/crates/2-http-client/src/main.rs index 91c3927..51cadb5 100644 --- a/crates/2-http-client/src/main.rs +++ b/crates/2-http-client/src/main.rs @@ -1,4 +1,4 @@ -#[cfg(all(target_os = "vita", feature = "shims"))] +#[cfg(all(target_os = "vita"))] use vita_newlib_shims as _; use oxhttp::{ @@ -17,6 +17,7 @@ fn main() -> anyhow::Result<()> { .enable_all() .build()? .block_on(async { + println!(">>>"); println!(">>> Trying oxhttp"); let client = Client::new(); let body = client @@ -25,11 +26,12 @@ fn main() -> anyhow::Result<()> { .to_string()?; println!(">>> oxhttp response: {body}"); - // Requires std to depend on the latest libc - // println!(">>> Trying ureq"); - // let body = ureq::get("http://example.com").call()?; - // println!(">>> Ureq response: {:?}", body); + println!(">>>"); + println!(">>> Trying ureq"); + let res = ureq::get("http://example.com").call()?.into_string()?; + println!(">>> Ureq response: {:?}", res); + println!(">>>"); println!(">>> Trying reqwest"); let body = reqwest::get("https://example.com").await?.text().await?; println!(">>> Reqwest response: {:#?}", body); diff --git a/crates/3-sdl/src/main.rs b/crates/3-sdl/src/main.rs index cb41c04..5ab4b82 100644 --- a/crates/3-sdl/src/main.rs +++ b/crates/3-sdl/src/main.rs @@ -211,16 +211,13 @@ pub fn main() -> Result<(), String> { let available = controller_subsystem .num_joysticks() .map_err(|e| format!("can't enumerate joysticks: {}", e))?; - let controller = (0..available) + let _controller = (0..available) .find_map(|id| { if !controller_subsystem.is_game_controller(id) { return None; } - match controller_subsystem.open(id) { - Ok(c) => Some(c), - Err(e) => None, - } + controller_subsystem.open(id).ok() }) .expect("Couldn't open any controller");