Skip to content
Open
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
31 changes: 30 additions & 1 deletion cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ serde_json = "1.0.96"
rmp-serde = "1.1.1"
uuid = { version = "1.4", features = ["serde", "v4"] }
dirs = "5.0.1"
rand = "0.8.5"
rand = "0.9.3"
opentelemetry = { version = "0.19.0", features = ["rt-tokio"] }
serde_bytes = "0.11.9"
chrono = { version = "0.4.26", features = ["serde", "std", "clock"], default-features = false }
Expand Down
8 changes: 4 additions & 4 deletions cli/src/tunnels/challenge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

#[cfg(not(feature = "vsda"))]
pub fn create_challenge() -> String {
use rand::distributions::{Alphanumeric, DistString};
Alphanumeric.sample_string(&mut rand::thread_rng(), 16)
use rand::distr::{Alphanumeric, SampleString};
Alphanumeric.sample_string(&mut rand::rng(), 16)
}

#[cfg(not(feature = "vsda"))]
Expand All @@ -26,8 +26,8 @@ pub fn verify_challenge(challenge: &str, response: &str) -> bool {

#[cfg(feature = "vsda")]
pub fn create_challenge() -> String {
use rand::distributions::{Alphanumeric, DistString};
let str = Alphanumeric.sample_string(&mut rand::thread_rng(), 16);
use rand::distr::{Alphanumeric, SampleString};
let str = Alphanumeric.sample_string(&mut rand::rng(), 16);
vsda::create_new_message(&str)
}

Expand Down
2 changes: 1 addition & 1 deletion cli/src/tunnels/code_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::util::http::{self, BoxedHttp};
use crate::util::io::SilentCopyProgress;
use crate::util::machine::process_exists;
use crate::util::prereqs::skip_requirements_check;
use crate::{debug, info, log, spanf, trace, warning};
use crate::log;
use lazy_static::lazy_static;
use opentelemetry::KeyValue;
use regex::Regex;
Expand Down
4 changes: 2 additions & 2 deletions cli/src/tunnels/dev_tunnels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::util::errors::{
WrappedError,
};
use crate::util::input::prompt_placeholder;
use crate::{debug, info, log, spanf, trace, warning};
use crate::log;
use async_trait::async_trait;
use futures::future::BoxFuture;
use futures::{FutureExt, TryFutureExt};
Expand Down Expand Up @@ -694,7 +694,7 @@ impl DevTunnels {
let recyclable = existing_tunnels
.iter()
.filter(|t| !tunnel_has_host_connection(t))
.choose(&mut rand::thread_rng());
.choose(&mut rand::rng());

match recyclable {
Some(tunnel) => {
Expand Down
9 changes: 2 additions & 7 deletions cli/src/tunnels/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,10 @@ pub enum PortPrivacy {
Private,
}

#[derive(Serialize, Deserialize, PartialEq, Copy, Eq, Clone, Debug)]
#[derive(Serialize, Deserialize, PartialEq, Copy, Eq, Clone, Debug, Default)]
#[serde(rename_all = "lowercase")]
pub enum PortProtocol {
#[default]
Auto,
Http,
Https,
Expand All @@ -313,12 +314,6 @@ impl std::fmt::Display for PortProtocol {
}
}

impl Default for PortProtocol {
fn default() -> Self {
Self::Auto
}
}

impl PortProtocol {
pub fn to_contract_str(&self) -> &'static str {
match *self {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/update_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use serde::{Deserialize, Serialize};

use crate::{
constants::VSCODE_CLI_UPDATE_ENDPOINT,
debug, log, options, spanf,
log, options,
util::{
errors::{wrap, AnyError, CodeError, WrappedError},
http::{BoxedHttp, SimpleResponse},
Expand Down
2 changes: 1 addition & 1 deletion cli/src/util/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ mod tests {
.truncate(true)
.open(&file_path)
.unwrap();
let mut rng = rand::thread_rng();
let mut rng = rand::rng();

let mut written = vec![];
let base_line = "Elit ipsum cillum ex cillum. Adipisicing consequat cupidatat do proident ut in sunt Lorem ipsum tempor. Eiusmod ipsum Lorem labore exercitation sunt pariatur excepteur fugiat cillum velit cillum enim. Nisi Lorem cupidatat ad enim velit officia eiusmod esse tempor aliquip. Deserunt pariatur tempor in duis culpa esse sit nulla irure ullamco ipsum voluptate non laboris. Occaecat officia nulla officia mollit do aliquip reprehenderit ad incididunt.";
Expand Down
Loading