comparison rust/hg-core/src/utils/files.rs @ 49930:e98fd81bb151

rust-clippy: fix most warnings in `hg-core` All of these are simple changes that for the most part are clear improvements and the rest are at most equivalent. The remaining warnings have to be fixed either with a bigger refactor like for the nested "revlog" module, or in the dependency `bytes-cast`, which we own. This will be done sometime in the future.
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 09 Jan 2023 19:18:43 +0100
parents 789475ef2b22
children 532e74ad3ff6
comparison
equal deleted inserted replaced
49929:5f1cd6839c69 49930:e98fd81bb151
228 }; 228 };
229 } 229 }
230 // TODO hint to the user about using --cwd 230 // TODO hint to the user about using --cwd
231 // Bubble up the responsibility to Python for now 231 // Bubble up the responsibility to Python for now
232 Err(HgPathError::NotUnderRoot { 232 Err(HgPathError::NotUnderRoot {
233 path: original_name.to_owned(), 233 path: original_name,
234 root: root.to_owned(), 234 root: root.to_owned(),
235 }) 235 })
236 } 236 }
237 } 237 }
238 238
422 Ok(PathBuf::from("")) 422 Ok(PathBuf::from(""))
423 ); 423 );
424 assert_eq!( 424 assert_eq!(
425 canonical_path(&root, Path::new(""), &beneath_repo), 425 canonical_path(&root, Path::new(""), &beneath_repo),
426 Err(HgPathError::NotUnderRoot { 426 Err(HgPathError::NotUnderRoot {
427 path: beneath_repo.to_owned(), 427 path: beneath_repo,
428 root: root.to_owned() 428 root: root.to_owned()
429 }) 429 })
430 ); 430 );
431 assert_eq!( 431 assert_eq!(
432 canonical_path(&root, Path::new(""), &under_repo_symlink), 432 canonical_path(&root, Path::new(""), &under_repo_symlink),