Skip to content

Commit 7bddeef

Browse files
committed
More updates
base64 0.21 to 0.22 dirs 4 to 6 http 0.2 to removed entirely: the only usage was `PathAndQuery`, which comes from actix_web`'s re-export rand 0.8 to 0.10: `thread_rng()` -> `rng()`, `gen()` -> `random()`, `Rng` -> `RngExt
1 parent 4001afe commit 7bddeef

7 files changed

Lines changed: 33 additions & 58 deletions

File tree

Cargo.lock

Lines changed: 21 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ark = { path = "crates/ark" }
3535
ark_test = { path = "crates/ark_test" }
3636
assert_matches = "1.5.0"
3737
async-trait = "0.1.89"
38-
base64 = "0.21.7"
38+
base64 = "0.22.1"
3939
biome_line_index = { git = "https://github.com/lionel-/biome", rev = "41d799cfa4cedd25625fc3f6bd7898532873f051" }
4040
biome_rowan = { git = "https://github.com/lionel-/biome", rev = "41d799cfa4cedd25625fc3f6bd7898532873f051" }
4141
blake3 = "1.8.4"
@@ -47,7 +47,7 @@ crossbeam = { version = "0.8.4", features = ["crossbeam-channel"] }
4747
ctor = "0.1.26"
4848
dap = { branch = "main", git = "https://github.com/sztomi/dap-rs" }
4949
dashmap = "6.1.0"
50-
dirs = "4.0.0"
50+
dirs = "6.0.0"
5151
ego-tree = "0.6.3"
5252
embed-resource = "3.0.8"
5353
env_logger = "0.11.10"
@@ -59,7 +59,6 @@ harp-macros = { path = "crates/harp/harp-macros" }
5959
hex = "0.4.3"
6060
hmac = "0.13.0"
6161
home = "0.5.12"
62-
http = "0.2.12"
6362
insta = "1.47.2"
6463
itertools = "0.14.0"
6564
libc = "0.2.185"
@@ -79,7 +78,7 @@ once_cell = "1.21.4"
7978
parking_lot = "0.12.5"
8079
paste = "1.0.15"
8180
quote = "1.0.45"
82-
rand = "0.8.6"
81+
rand = "0.10"
8382
regex = "1.12.3"
8483
reqwest = { version = "0.13.2", default-features = false, features = ["blocking", "json", "rustls"] }
8584
reqwest-middleware = "0.5.1"

crates/amalthea/src/fixtures/dummy_frontend.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
use assert_matches::assert_matches;
9-
use rand::Rng;
9+
use rand::RngExt;
1010
use serde_json::Value;
1111

1212
use crate::connection_file::ConnectionFile;
@@ -63,7 +63,7 @@ impl Default for DummyConnection {
6363
impl DummyConnection {
6464
pub fn new() -> Self {
6565
// Create a random HMAC key for signing messages.
66-
let key_bytes = rand::thread_rng().gen::<[u8; 16]>();
66+
let key_bytes = rand::rng().random::<[u8; 16]>();
6767
let key = hex::encode(key_bytes);
6868

6969
// Create a new kernel session from the key
@@ -142,7 +142,7 @@ impl DummyFrontend {
142142

143143
// Create a random socket identity for the shell and stdin sockets. Per
144144
// the Jupyter specification, these must share a ZeroMQ identity.
145-
let shell_id = rand::thread_rng().gen::<[u8; 16]>();
145+
let shell_id = rand::rng().random::<[u8; 16]>();
146146

147147
let control_socket = Socket::new(
148148
connection.session.clone(),

crates/ark/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ ego-tree.workspace = true
3636
futures.workspace = true
3737
harp.workspace = true
3838
home.workspace = true
39-
http.workspace = true
4039
itertools.workspace = true
4140
libc.workspace = true
4241
libr.workspace = true

crates/ark/src/help_proxy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ use std::net::TcpListener;
99

1010
use actix_web::get;
1111
use actix_web::http::header::ContentType;
12+
use actix_web::http::uri::PathAndQuery;
1213
use actix_web::web;
1314
use actix_web::App;
1415
use actix_web::HttpRequest;
1516
use actix_web::HttpResponse;
1617
use actix_web::HttpServer;
1718
use harp::exec::RFunction;
1819
use harp::exec::RFunctionExt;
19-
use http::uri::PathAndQuery;
2020
use mime_guess::from_path;
2121
use reqwest::Client;
2222
use reqwest_middleware::ClientBuilder;

crates/ark/src/plots/graphics_device.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ use amalthea::wire::update_display_data::TransientValue;
3939
use amalthea::wire::update_display_data::UpdateDisplayData;
4040
use anyhow::anyhow;
4141
use anyhow::Context;
42-
use base64::engine::general_purpose;
43-
use base64::Engine;
42+
use base64::prelude::*;
4443
use crossbeam::channel::Select;
4544
use crossbeam::channel::Sender;
4645
use harp::exec::RFunction;
@@ -1023,7 +1022,7 @@ impl DeviceContext {
10231022
reader.read_to_end(&mut buffer)?;
10241023

10251024
// what an odd interface
1026-
let data = general_purpose::STANDARD_NO_PAD.encode(buffer);
1025+
let data = BASE64_STANDARD_NO_PAD.encode(buffer);
10271026

10281027
Ok(data)
10291028
}

crates/ark/tests/plots.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use amalthea::wire::execute_request::JupyterPositronRange;
66
use ark_test::comm::RECV_TIMEOUT;
77
use ark_test::DummyArkFrontend;
88
use ark_test::SourceFile;
9-
use base64::Engine;
9+
use base64::prelude::*;
1010

1111
/// Default DPI for the current OS, matching the constant in graphics_device.rs.
1212
fn default_dpi() -> f64 {
@@ -21,9 +21,9 @@ fn default_dpi() -> f64 {
2121
fn png_dimensions(base64_data: &str) -> (u32, u32) {
2222
// The base64 data may contain newlines or use non-padded encoding
2323
let cleaned: String = base64_data.chars().filter(|c| !c.is_whitespace()).collect();
24-
let bytes = base64::engine::general_purpose::STANDARD
24+
let bytes = BASE64_STANDARD
2525
.decode(&cleaned)
26-
.or_else(|_| base64::engine::general_purpose::STANDARD_NO_PAD.decode(&cleaned))
26+
.or_else(|_| BASE64_STANDARD_NO_PAD.decode(&cleaned))
2727
.expect("Failed to decode base64 PNG data");
2828
// Validate PNG signature and minimum size for IHDR
2929
let png_signature: [u8; 8] = [137, 80, 78, 71, 13, 10, 26, 10];

0 commit comments

Comments
 (0)