chore: Bump Rust edition to 2024 (#27800)
Follow-up to https://github.com/zed-industries/zed/pull/27791 Release Notes: - N/A
This commit is contained in:
parent
d50905e000
commit
dc64ec9cc8
802 changed files with 3775 additions and 3662 deletions
|
@ -3,7 +3,7 @@ mod connection_pool;
|
|||
use crate::api::{CloudflareIpCountryHeader, SystemIdHeader};
|
||||
use crate::llm::LlmTokenClaims;
|
||||
use crate::{
|
||||
auth,
|
||||
AppState, Config, Error, RateLimit, Result, auth,
|
||||
db::{
|
||||
self, BufferId, Capability, Channel, ChannelId, ChannelRole, ChannelsForUser,
|
||||
CreatedChannelMessage, Database, InviteMemberResult, MembershipUpdated, MessageId,
|
||||
|
@ -11,47 +11,46 @@ use crate::{
|
|||
RespondToChannelInvite, RoomId, ServerId, UpdatedChannelMessage, User, UserId,
|
||||
},
|
||||
executor::Executor,
|
||||
AppState, Config, Error, RateLimit, Result,
|
||||
};
|
||||
use anyhow::{anyhow, bail, Context as _};
|
||||
use anyhow::{Context as _, anyhow, bail};
|
||||
use async_tungstenite::tungstenite::{
|
||||
protocol::CloseFrame as TungsteniteCloseFrame, Message as TungsteniteMessage,
|
||||
Message as TungsteniteMessage, protocol::CloseFrame as TungsteniteCloseFrame,
|
||||
};
|
||||
use axum::{
|
||||
Extension, Router, TypedHeader,
|
||||
body::Body,
|
||||
extract::{
|
||||
ws::{CloseFrame as AxumCloseFrame, Message as AxumMessage},
|
||||
ConnectInfo, WebSocketUpgrade,
|
||||
ws::{CloseFrame as AxumCloseFrame, Message as AxumMessage},
|
||||
},
|
||||
headers::{Header, HeaderName},
|
||||
http::StatusCode,
|
||||
middleware,
|
||||
response::IntoResponse,
|
||||
routing::get,
|
||||
Extension, Router, TypedHeader,
|
||||
};
|
||||
use chrono::Utc;
|
||||
use collections::{HashMap, HashSet};
|
||||
pub use connection_pool::{ConnectionPool, ZedVersion};
|
||||
use core::fmt::{self, Debug, Formatter};
|
||||
use http_client::HttpClient;
|
||||
use open_ai::{OpenAiEmbeddingModel, OPEN_AI_API_URL};
|
||||
use open_ai::{OPEN_AI_API_URL, OpenAiEmbeddingModel};
|
||||
use reqwest_client::ReqwestClient;
|
||||
use rpc::proto::split_repository_update;
|
||||
use sha2::Digest;
|
||||
use supermaven_api::{CreateExternalUserRequest, SupermavenAdminApi};
|
||||
|
||||
use futures::{
|
||||
channel::oneshot, future::BoxFuture, stream::FuturesUnordered, FutureExt, SinkExt, StreamExt,
|
||||
TryStreamExt,
|
||||
FutureExt, SinkExt, StreamExt, TryStreamExt, channel::oneshot, future::BoxFuture,
|
||||
stream::FuturesUnordered,
|
||||
};
|
||||
use prometheus::{register_int_gauge, IntGauge};
|
||||
use prometheus::{IntGauge, register_int_gauge};
|
||||
use rpc::{
|
||||
Connection, ConnectionId, ErrorCode, ErrorCodeExt, ErrorExt, Peer, Receipt, TypedEnvelope,
|
||||
proto::{
|
||||
self, Ack, AnyTypedEnvelope, EntityMessage, EnvelopedMessage, LiveKitConnectionInfo,
|
||||
RequestMessage, ShareProject, UpdateChannelBufferCollaborators,
|
||||
},
|
||||
Connection, ConnectionId, ErrorCode, ErrorCodeExt, ErrorExt, Peer, Receipt, TypedEnvelope,
|
||||
};
|
||||
use semantic_version::SemanticVersion;
|
||||
use serde::{Serialize, Serializer};
|
||||
|
@ -64,17 +63,18 @@ use std::{
|
|||
ops::{Deref, DerefMut},
|
||||
rc::Rc,
|
||||
sync::{
|
||||
atomic::{AtomicBool, Ordering::SeqCst},
|
||||
Arc, OnceLock,
|
||||
atomic::{AtomicBool, Ordering::SeqCst},
|
||||
},
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
use time::OffsetDateTime;
|
||||
use tokio::sync::{watch, MutexGuard, Semaphore};
|
||||
use tokio::sync::{MutexGuard, Semaphore, watch};
|
||||
use tower::ServiceBuilder;
|
||||
use tracing::{
|
||||
Instrument,
|
||||
field::{self},
|
||||
info_span, instrument, Instrument,
|
||||
info_span, instrument,
|
||||
};
|
||||
|
||||
pub const RECONNECT_TIMEOUT: Duration = Duration::from_secs(30);
|
||||
|
@ -1115,7 +1115,7 @@ pub async fn handle_websocket_request(
|
|||
.into_response();
|
||||
}
|
||||
|
||||
let Some(version) = app_version_header.map(|header| ZedVersion(header.0 .0)) else {
|
||||
let Some(version) = app_version_header.map(|header| ZedVersion(header.0.0)) else {
|
||||
return (
|
||||
StatusCode::UPGRADE_REQUIRED,
|
||||
"no version header found".to_string(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue