Remove unnecessary allocations (#49)

This commit is contained in:
Taiki Endo
2020-05-20 05:37:02 +09:00
committed by GitHub
parent bbaa16c6f5
commit 4c9edec0b1
4 changed files with 14 additions and 19 deletions

View File

@@ -19,7 +19,7 @@ pub async fn main() -> mini_redis::Result<()> {
tracing_subscriber::fmt::try_init()?;
let cli = Cli::from_args();
let port = cli.port.unwrap_or(DEFAULT_PORT.to_string());
let port = cli.port.as_deref().unwrap_or(DEFAULT_PORT);
// Bind a TCP listener
let listener = TcpListener::bind(&format!("127.0.0.1:{}", port)).await?;