use impl instead of generic syntax

This commit is contained in:
Rowan 2024-09-28 03:08:08 -05:00
parent 7ea0b26930
commit 63dde64003

View file

@ -6,7 +6,7 @@ use std::{
use clap::Parser;
use rand::distributions::{Alphanumeric, DistString};
fn rename_or_copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<()> {
fn rename_or_copy(from: impl AsRef<Path>, to: impl AsRef<Path>) -> io::Result<()> {
match fs::rename(&from, &to) {
Ok(result) => Ok(result),
Err(_) => {