Simplify some more closures.
//! as well as for the RTR server.
use std::{env, fmt, fs, io};
+use std::ffi::OsStr;
use std::io::{Read, Write};
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
use std::path::{Path, PathBuf};
@@ -632,11 +633,7 @@ impl Config {
facility: syslog::Facility
) -> Result<Box<dyn Log>, Error> {
let process = env::current_exe().ok().and_then(|path|
- path.file_name().and_then(|os_name|
- os_name.to_str()
- ).map(|name|
- name.to_string()
- )
+ path.file_name().and_then(OsStr::to_str).map(ToString::to_string)
).unwrap_or_else(|| String::from("routinator"));
let pid = unsafe { libc::getpid() };
let formatter = syslog::Formatter3164 {
