Skip to content

Commit

Permalink
Bump Rust to 1.78 (#4992)
Browse files Browse the repository at this point in the history
  • Loading branch information
guilload committed May 16, 2024
1 parent d0f267e commit fe89054
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 deletions.
6 changes: 3 additions & 3 deletions quickwit/quickwit-actors/src/actor_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ impl<A: Actor> ActorContext<A> {
/// This method hides logic to prevent an actor from being identified
/// as frozen if the destination actor channel is saturated, and we
/// are simply experiencing back pressure.
pub async fn send_message<DestActor: Actor, M>(
pub async fn send_message<DestActor, M>(
&self,
mailbox: &Mailbox<DestActor>,
msg: M,
Expand All @@ -260,7 +260,7 @@ impl<A: Actor> ActorContext<A> {
.await
}

pub async fn ask<DestActor: Actor, M, T>(
pub async fn ask<DestActor, M, T>(
&self,
mailbox: &Mailbox<DestActor>,
msg: M,
Expand All @@ -278,7 +278,7 @@ impl<A: Actor> ActorContext<A> {

/// Similar to `send_message`, except this method
/// waits asynchronously for the actor reply.
pub async fn ask_for_res<DestActor: Actor, M, T, E>(
pub async fn ask_for_res<DestActor, M, T, E>(
&self,
mailbox: &Mailbox<DestActor>,
msg: M,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

use std::fmt;
use std::str::FromStr;
use std::time::Duration;

Expand Down Expand Up @@ -312,14 +313,15 @@ impl FromStr for ExpandWildcards {
}
}
}
impl ToString for ExpandWildcards {
fn to_string(&self) -> String {
match &self {
Self::Open => "open".to_string(),
Self::Closed => "closed".to_string(),
Self::Hidden => "hidden".to_string(),
Self::None => "none".to_string(),
Self::All => "all".to_string(),

impl fmt::Display for ExpandWildcards {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::Open => write!(formatter, "open"),
Self::Closed => write!(formatter, "closed"),
Self::Hidden => write!(formatter, "hidden"),
Self::None => write!(formatter, "none"),
Self::All => write!(formatter, "all"),
}
}
}
Expand Down Expand Up @@ -358,12 +360,13 @@ impl FromStr for SuggestMode {
}
}
}
impl ToString for SuggestMode {
fn to_string(&self) -> String {
match &self {
Self::Missing => "missing".to_string(),
Self::Popular => "popular".to_string(),
Self::Always => "always".to_string(),

impl fmt::Display for SuggestMode {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
match self {
Self::Missing => write!(formatter, "missing"),
Self::Popular => write!(formatter, "popular"),
Self::Always => write!(formatter, "always"),
}
}
}
10 changes: 6 additions & 4 deletions quickwit/quickwit-serve/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

use std::fmt;

use hyper::header::CONTENT_TYPE;
use quickwit_config::ConfigFormat;
use serde::{self, Deserialize, Serialize, Serializer};
Expand Down Expand Up @@ -55,11 +57,11 @@ impl BodyFormat {
}
}

impl ToString for BodyFormat {
fn to_string(&self) -> String {
impl fmt::Display for BodyFormat {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
match &self {
Self::Json => "json".to_string(),
Self::PrettyJson => "pretty_json".to_string(),
Self::Json => write!(formatter, "json"),
Self::PrettyJson => write!(formatter, "pretty_json"),
}
}
}
Expand Down

0 comments on commit fe89054

Please sign in to comment.