forked from mirrors/jj
Fix some cargo +nightly clippy
warnings
This commit is contained in:
parent
ce3397c2cb
commit
0b528eb587
5 changed files with 6 additions and 6 deletions
|
@ -112,7 +112,7 @@ mod tests {
|
||||||
let target = temp_dir.path().join("file");
|
let target = temp_dir.path().join("file");
|
||||||
let mut temp_file = NamedTempFile::new_in(&temp_dir).unwrap();
|
let mut temp_file = NamedTempFile::new_in(&temp_dir).unwrap();
|
||||||
temp_file.write_all(b"contents").unwrap();
|
temp_file.write_all(b"contents").unwrap();
|
||||||
assert!(persist_content_addressed_temp_file(temp_file, &target).is_ok());
|
assert!(persist_content_addressed_temp_file(temp_file, target).is_ok());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test_case(false ; "existing file open")]
|
#[test_case(false ; "existing file open")]
|
||||||
|
|
|
@ -303,7 +303,7 @@ fn upgrade_old_export_state(repo: &Arc<ReadonlyRepo>) {
|
||||||
if let Ok(mut last_export_file) = OpenOptions::new()
|
if let Ok(mut last_export_file) = OpenOptions::new()
|
||||||
.write(true)
|
.write(true)
|
||||||
.create(true)
|
.create(true)
|
||||||
.open(&repo.repo_path().join("git_export_view"))
|
.open(repo.repo_path().join("git_export_view"))
|
||||||
{
|
{
|
||||||
let thrift_view = simple_op_store_model::View::from(&last_export_store_view);
|
let thrift_view = simple_op_store_model::View::from(&last_export_store_view);
|
||||||
simple_op_store::write_thrift(&thrift_view, &mut last_export_file)
|
simple_op_store::write_thrift(&thrift_view, &mut last_export_file)
|
||||||
|
|
|
@ -122,7 +122,7 @@ fn upgrade_to_thrift(store_path: PathBuf) -> std::io::Result<()> {
|
||||||
|
|
||||||
fs::write(tmp_store_path.join("thrift_store"), "")?;
|
fs::write(tmp_store_path.join("thrift_store"), "")?;
|
||||||
let backup_store_path = store_path.parent().unwrap().join("op_store_old");
|
let backup_store_path = store_path.parent().unwrap().join("op_store_old");
|
||||||
fs::rename(&store_path, &backup_store_path)?;
|
fs::rename(&store_path, backup_store_path)?;
|
||||||
fs::rename(&tmp_store_path, &store_path)?;
|
fs::rename(&tmp_store_path, &store_path)?;
|
||||||
|
|
||||||
// Update the pointers to the head(s) of the operation log
|
// Update the pointers to the head(s) of the operation log
|
||||||
|
@ -157,7 +157,7 @@ fn upgrade_to_thrift(store_path: PathBuf) -> std::io::Result<()> {
|
||||||
// Update the pointer to the last operation exported to Git
|
// Update the pointer to the last operation exported to Git
|
||||||
let git_export_path = store_path.parent().unwrap().join("git_export_operation_id");
|
let git_export_path = store_path.parent().unwrap().join("git_export_operation_id");
|
||||||
if let Ok(op_id_string) = fs::read_to_string(&git_export_path) {
|
if let Ok(op_id_string) = fs::read_to_string(&git_export_path) {
|
||||||
if let Ok(op_id_bytes) = hex::decode(&op_id_string) {
|
if let Ok(op_id_bytes) = hex::decode(op_id_string) {
|
||||||
let old_op_id = OperationId::new(op_id_bytes);
|
let old_op_id = OperationId::new(op_id_bytes);
|
||||||
let new_op_id = converted.get(&old_op_id).unwrap();
|
let new_op_id = converted.get(&old_op_id).unwrap();
|
||||||
fs::write(&git_export_path, new_op_id.hex())?;
|
fs::write(&git_export_path, new_op_id.hex())?;
|
||||||
|
|
|
@ -228,7 +228,7 @@ impl Ui {
|
||||||
"Cannot prompt for input since the output is not connected to a terminal",
|
"Cannot prompt for input since the output is not connected to a terminal",
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
rpassword::prompt_password(&format!("{}: ", prompt))
|
rpassword::prompt_password(format!("{prompt}: "))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn size(&self) -> Option<(u16, u16)> {
|
pub fn size(&self) -> Option<(u16, u16)> {
|
||||||
|
|
|
@ -44,7 +44,7 @@ fn test_commit_with_editor() {
|
||||||
test_env.jj_cmd_success(&workspace_path, &["describe", "-m=initial"]);
|
test_env.jj_cmd_success(&workspace_path, &["describe", "-m=initial"]);
|
||||||
let edit_script = test_env.set_up_fake_editor();
|
let edit_script = test_env.set_up_fake_editor();
|
||||||
std::fs::write(
|
std::fs::write(
|
||||||
&edit_script,
|
edit_script,
|
||||||
"expect
|
"expect
|
||||||
initial
|
initial
|
||||||
JJ: Lines starting with \"JJ: \" (like this one) will be removed.
|
JJ: Lines starting with \"JJ: \" (like this one) will be removed.
|
||||||
|
|
Loading…
Reference in a new issue