From 82ff5b9c9be4ad4aace558cba196bf92a409c86b Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Thu, 1 Aug 2024 09:15:24 +0300 Subject: [PATCH] core: Remove useless use of format!() --- core/io/darwin.rs | 4 +--- core/vdbe/explain.rs | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/core/io/darwin.rs b/core/io/darwin.rs index 06b057f65..c2ec6345d 100644 --- a/core/io/darwin.rs +++ b/core/io/darwin.rs @@ -143,9 +143,7 @@ impl File for DarwinFile { if lock_result == -1 { let err = std::io::Error::last_os_error(); if err.kind() == std::io::ErrorKind::WouldBlock { - return Err(LimboError::LockingError(format!( - "Failed locking file. File is locked by another process" - ))); + return Err(LimboError::LockingError("Failed locking file. File is locked by another process".to_string())); } else { return Err(LimboError::LockingError(format!( "Failed locking file, {}", diff --git a/core/vdbe/explain.rs b/core/vdbe/explain.rs index 242428170..98f3d0c91 100644 --- a/core/vdbe/explain.rs +++ b/core/vdbe/explain.rs @@ -518,7 +518,7 @@ pub fn insn_to_str(program: &Program, addr: InsnReference, insn: &Insn, indent: *start_offset as i32, OwnedValue::Text(Rc::new("".to_string())), 0, - format!(""), + "".to_string(), ), Insn::EndCoroutine { yield_reg } => ( "EndCoroutine", @@ -527,7 +527,7 @@ pub fn insn_to_str(program: &Program, addr: InsnReference, insn: &Insn, indent: 0, OwnedValue::Text(Rc::new("".to_string())), 0, - format!(""), + "".to_string(), ), Insn::Yield { yield_reg, @@ -539,7 +539,7 @@ pub fn insn_to_str(program: &Program, addr: InsnReference, insn: &Insn, indent: 0, OwnedValue::Text(Rc::new("".to_string())), 0, - format!(""), + "".to_string(), ), Insn::InsertAsync { cursor, @@ -553,7 +553,7 @@ pub fn insn_to_str(program: &Program, addr: InsnReference, insn: &Insn, indent: *key_reg as i32, OwnedValue::Text(Rc::new("".to_string())), *flag as u16, - format!(""), + "".to_string(), ), Insn::InsertAwait { cursor_id } => ( "InsertAwait", @@ -562,7 +562,7 @@ pub fn insn_to_str(program: &Program, addr: InsnReference, insn: &Insn, indent: 0, OwnedValue::Text(Rc::new("".to_string())), 0, - format!(""), + "".to_string(), ), Insn::NewRowid { reg } => ( "NewRowId", @@ -571,7 +571,7 @@ pub fn insn_to_str(program: &Program, addr: InsnReference, insn: &Insn, indent: 0, OwnedValue::Text(Rc::new("".to_string())), 0, - format!(""), + "".to_string(), ), Insn::MustBeInt { reg } => ( "MustBeInt", @@ -580,7 +580,7 @@ pub fn insn_to_str(program: &Program, addr: InsnReference, insn: &Insn, indent: 0, OwnedValue::Text(Rc::new("".to_string())), 0, - format!(""), + "".to_string(), ), Insn::SoftNull { reg } => ( "SoftNull", @@ -589,7 +589,7 @@ pub fn insn_to_str(program: &Program, addr: InsnReference, insn: &Insn, indent: 0, OwnedValue::Text(Rc::new("".to_string())), 0, - format!(""), + "".to_string(), ), Insn::NotExists { cursor, @@ -602,7 +602,7 @@ pub fn insn_to_str(program: &Program, addr: InsnReference, insn: &Insn, indent: *rowid_reg as i32, OwnedValue::Text(Rc::new("".to_string())), 0, - format!(""), + "".to_string(), ), Insn::OpenWriteAsync { cursor_id, @@ -614,7 +614,7 @@ pub fn insn_to_str(program: &Program, addr: InsnReference, insn: &Insn, indent: 0, OwnedValue::Text(Rc::new("".to_string())), 0, - format!(""), + "".to_string(), ), Insn::OpenWriteAwait {} => ( "OpenWriteAwait", @@ -623,7 +623,7 @@ pub fn insn_to_str(program: &Program, addr: InsnReference, insn: &Insn, indent: 0, OwnedValue::Text(Rc::new("".to_string())), 0, - format!(""), + "".to_string(), ), Insn::Copy { src_reg, @@ -636,7 +636,7 @@ pub fn insn_to_str(program: &Program, addr: InsnReference, insn: &Insn, indent: *amount as i32, OwnedValue::Text(Rc::new("".to_string())), 0, - format!(""), + "".to_string(), ), }; format!(