mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-23 15:51:06 +01:00
fmt
This commit is contained in:
parent
c08cd8a23a
commit
ab3f591307
@ -35,9 +35,9 @@ impl<'de> de::Deserialize<'de> for Backlog {
|
||||
impl<'de> de::Visitor<'de> for BacklogVisitor {
|
||||
type Value = Backlog;
|
||||
|
||||
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let msg = "Either \"default\" or a string containing an integer > 0";
|
||||
formatter.write_str(msg)
|
||||
f.write_str(msg)
|
||||
}
|
||||
|
||||
fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
|
||||
|
@ -58,9 +58,9 @@ impl<'de> de::Deserialize<'de> for KeepAlive {
|
||||
impl<'de> de::Visitor<'de> for KeepAliveVisitor {
|
||||
type Value = KeepAlive;
|
||||
|
||||
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let msg = "Either \"default\", \"disabled\", \"os\", or a string of the format \"N seconds\" where N is an integer > 0";
|
||||
formatter.write_str(msg)
|
||||
f.write_str(msg)
|
||||
}
|
||||
|
||||
fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
|
||||
|
@ -35,9 +35,9 @@ impl<'de> de::Deserialize<'de> for MaxConnectionRate {
|
||||
impl<'de> de::Visitor<'de> for MaxConnectionRateVisitor {
|
||||
type Value = MaxConnectionRate;
|
||||
|
||||
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let msg = "Either \"default\" or a string containing an integer > 0";
|
||||
formatter.write_str(msg)
|
||||
f.write_str(msg)
|
||||
}
|
||||
|
||||
fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
|
||||
|
@ -35,9 +35,9 @@ impl<'de> de::Deserialize<'de> for MaxConnections {
|
||||
impl<'de> de::Visitor<'de> for MaxConnectionsVisitor {
|
||||
type Value = MaxConnections;
|
||||
|
||||
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let msg = "Either \"default\" or a string containing an integer > 0";
|
||||
formatter.write_str(msg)
|
||||
f.write_str(msg)
|
||||
}
|
||||
|
||||
fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
|
||||
|
@ -2,14 +2,10 @@ use serde::Deserialize;
|
||||
|
||||
use crate::{AtResult, Parse};
|
||||
|
||||
/// Marker of intended deployment environment.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash, Deserialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum Mode {
|
||||
/// Marks development environment.
|
||||
Development,
|
||||
|
||||
/// Marks production environment.
|
||||
Production,
|
||||
}
|
||||
|
||||
|
@ -35,9 +35,9 @@ impl<'de> de::Deserialize<'de> for NumWorkers {
|
||||
impl<'de> de::Visitor<'de> for NumWorkersVisitor {
|
||||
type Value = NumWorkers;
|
||||
|
||||
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let msg = "Either \"default\" or a string containing an integer > 0";
|
||||
formatter.write_str(msg)
|
||||
f.write_str(msg)
|
||||
}
|
||||
|
||||
fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
|
||||
|
@ -64,9 +64,9 @@ impl<'de> de::Deserialize<'de> for Timeout {
|
||||
impl<'de> de::Visitor<'de> for TimeoutVisitor {
|
||||
type Value = Timeout;
|
||||
|
||||
fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fn expecting(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let msg = "Either \"default\", \"disabled\", \"os\", or a string of the format \"N seconds\" where N is an integer > 0";
|
||||
formatter.write_str(msg)
|
||||
f.write_str(msg)
|
||||
}
|
||||
|
||||
fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
|
||||
|
Loading…
Reference in New Issue
Block a user