bumped rust

This commit is contained in:
Eugene Pankov 2022-11-03 23:10:51 +01:00
parent 96d0d95e80
commit 42f9c68788
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4
16 changed files with 21 additions and 23 deletions

View file

@ -1 +1 @@
nightly-2022-08-01
nightly-2022-10-01

View file

@ -1,4 +1,4 @@
#![feature(decl_macro, proc_macro_hygiene, let_else)]
#![feature(decl_macro, proc_macro_hygiene)]
mod api;
use poem::{EndpointExt, IntoEndpoint, Route};
use poem_openapi::OpenApiService;

View file

@ -1,4 +1,4 @@
#![feature(type_alias_impl_trait, let_else, try_blocks)]
#![feature(type_alias_impl_trait, try_blocks)]
mod api;
use poem_openapi::OpenApiService;
use regex::Regex;

View file

@ -1,4 +1,4 @@
#![feature(let_else, drain_filter, duration_constants)]
#![feature(drain_filter, duration_constants)]
pub mod auth;
mod config;
pub mod consts;

View file

@ -1,4 +1,4 @@
#![feature(let_else, drain_filter, duration_constants)]
#![feature(drain_filter, duration_constants, try_blocks)]
pub mod consts;
mod data;
mod state;

View file

@ -54,9 +54,7 @@ pub fn install_database_logger(database: Arc<Mutex<DatabaseConnection>>) {
fn values_to_log_entry_data(mut values: SerializedRecordValues) -> Option<LogEntry::ActiveModel> {
let session_id = (*values).remove("session");
let username = (*values).remove("session_username");
let message = (*values)
.remove("message")
.unwrap_or_else(|| "".to_string());
let message = (*values).remove("message").unwrap_or_default();
use sea_orm::ActiveValue::Set;
let session_id = session_id.and_then(|x| Uuid::parse_str(&x).ok());

View file

@ -17,13 +17,13 @@ impl MySqlBufMutExt for Vec<u8> {
self.push(v as u8);
} else if v < 0x1_00_00 {
self.push(0xfc);
self.extend(&(v as u16).to_le_bytes());
self.extend((v as u16).to_le_bytes());
} else if v < 0x1_00_00_00 {
self.push(0xfd);
self.extend(&(v as u32).to_le_bytes()[..3]);
} else {
self.push(0xfe);
self.extend(&v.to_le_bytes());
self.extend(v.to_le_bytes());
}
}

View file

@ -12,19 +12,19 @@ pub struct SslRequest {
impl Encode<'_, Capabilities> for SslRequest {
fn encode_with(&self, buf: &mut Vec<u8>, capabilities: Capabilities) {
buf.extend(&(capabilities.bits() as u32).to_le_bytes());
buf.extend(&self.max_packet_size.to_le_bytes());
buf.extend((capabilities.bits() as u32).to_le_bytes());
buf.extend(self.max_packet_size.to_le_bytes());
buf.push(self.collation);
// reserved: string<19>
buf.extend(&[0_u8; 19]);
buf.extend([0_u8; 19]);
if capabilities.contains(Capabilities::MYSQL) {
// reserved: string<4>
buf.extend(&[0_u8; 4]);
buf.extend([0_u8; 4]);
} else {
// extended client capabilities (MariaDB-specified): int<4>
buf.extend(&((capabilities.bits() >> 32) as u32).to_le_bytes());
buf.extend(((capabilities.bits() >> 32) as u32).to_le_bytes());
}
}
}

View file

@ -21,7 +21,7 @@ where
) {
// reserve space to write the prefixed length
let offset = buf.len();
buf.extend(&[0_u8; 4]);
buf.extend([0_u8; 4]);
// encode the payload
self.0.encode_with(buf, capabilities);

View file

@ -53,7 +53,7 @@ impl Api {
version: env!("CARGO_PKG_VERSION").to_string(),
username: session.get_username(),
selected_target: session.get_target_name(),
external_host: external_host.map(&str::to_string),
external_host: external_host.map(str::to_string),
authorized_via_ticket: matches!(
session.get_auth(),
Some(SessionAuthorization::Ticket { .. })

View file

@ -99,7 +99,7 @@ impl Api {
code: Query<Option<String>>,
) -> poem::Result<Response<ReturnToSsoResponse>> {
let url = self
.api_return_to_sso_get_common(req, session, services, &*code)
.api_return_to_sso_get_common(req, session, services, &code)
.await?
.unwrap_or_else(|x| make_redirect_url(&x));

View file

@ -1,4 +1,4 @@
#![feature(type_alias_impl_trait, let_else, try_blocks)]
#![feature(type_alias_impl_trait, try_blocks)]
pub mod api;
mod catchall;
mod common;

View file

@ -1,4 +1,4 @@
#![feature(type_alias_impl_trait, let_else, try_blocks)]
#![feature(type_alias_impl_trait, try_blocks)]
use poem_openapi::OpenApiService;
use regex::Regex;
use warpgate_protocol_http::api;

View file

@ -1,4 +1,4 @@
#![feature(type_alias_impl_trait, let_else, try_blocks)]
#![feature(type_alias_impl_trait, try_blocks)]
mod client;
mod common;
mod error;

View file

@ -1,4 +1,4 @@
#![feature(type_alias_impl_trait, let_else)]
#![feature(type_alias_impl_trait)]
mod client;
mod common;
mod compat;

View file

@ -1,4 +1,4 @@
#![feature(type_alias_impl_trait, let_else)]
#![feature(type_alias_impl_trait)]
mod commands;
mod config;
mod logging;