Update to rust 2021
This commit is contained in:
@ -51,7 +51,7 @@ async fn dir(cfg: &Config, env: &Env, relative: PathBuf) -> Result<(), Errors> {
|
||||
let mut dir_tasks = vec![];
|
||||
let mut file_tasks = vec![];
|
||||
|
||||
while let Some(entry) = walker.next_entry().await.with_location(&&template_path)? {
|
||||
while let Some(entry) = walker.next_entry().await.with_location(&template_path)? {
|
||||
let meta = entry.metadata().await.with_location(&entry.path())?;
|
||||
let new_relative = relative.join(entry.file_name());
|
||||
|
||||
@ -98,7 +98,7 @@ async fn file(cfg: &Config, env: &Env, relative: PathBuf) -> Result<(), Error> {
|
||||
let mut rendered = Vec::<u8>::new();
|
||||
parse_template(&file_str)
|
||||
.with_location(&template_path)?
|
||||
.write(&env, &mut rendered)
|
||||
.write(env, &mut rendered)
|
||||
.with_location(&template_path)?;
|
||||
let rendered = std::str::from_utf8(&rendered).unwrap();
|
||||
|
||||
@ -122,7 +122,7 @@ fn get_username() -> String {
|
||||
env::var("USER")
|
||||
.ok()
|
||||
.or_else(|| env::var("USERNAME").ok())
|
||||
.unwrap_or_else(|| String::new())
|
||||
.unwrap_or_else(String::new)
|
||||
}
|
||||
|
||||
async fn get_hostname() -> String {
|
||||
@ -140,8 +140,8 @@ async fn get_hostname() -> String {
|
||||
|
||||
read_hostname_file()
|
||||
.await
|
||||
.or_else(|| run_hostname_cmd())
|
||||
.unwrap_or_else(|| String::new())
|
||||
.or_else(run_hostname_cmd)
|
||||
.unwrap_or_else(String::new)
|
||||
.trim()
|
||||
.to_string()
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ async fn dir(cfg: &Config, relative: PathBuf) -> Result<Vec<String>, Errors> {
|
||||
let mut dir_tasks = vec![];
|
||||
let mut file_tasks = vec![];
|
||||
|
||||
while let Some(entry) = walker.next_entry().await.with_location(&&template_path)? {
|
||||
while let Some(entry) = walker.next_entry().await.with_location(&template_path)? {
|
||||
let meta = entry.metadata().await.with_location(&entry.path())?;
|
||||
let new_relative = relative.join(entry.file_name());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user