mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-01 07:24:19 +01:00
whopper: Run cargo clippy --fix
This commit is contained in:
@@ -55,7 +55,7 @@ impl Drop for SimulatorIO {
|
||||
}
|
||||
} else {
|
||||
for path in paths.iter() {
|
||||
println!("Keeping file: {}", path);
|
||||
println!("Keeping file: {path}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -164,12 +164,12 @@ impl SimulatorFile {
|
||||
let fd = open(c_path.as_ptr(), O_CREAT | O_RDWR, 0o644);
|
||||
if fd == -1 {
|
||||
let errno = std::io::Error::last_os_error();
|
||||
panic!("Failed to create file {}: {}", file_path, errno);
|
||||
panic!("Failed to create file {file_path}: {errno}");
|
||||
}
|
||||
|
||||
if ftruncate(fd, FILE_SIZE as i64) == -1 {
|
||||
let errno = std::io::Error::last_os_error();
|
||||
panic!("Failed to truncate file {}: {}", file_path, errno);
|
||||
panic!("Failed to truncate file {file_path}: {errno}");
|
||||
}
|
||||
|
||||
let data = mmap(
|
||||
@@ -183,7 +183,7 @@ impl SimulatorFile {
|
||||
|
||||
if data == libc::MAP_FAILED as *mut u8 {
|
||||
let errno = std::io::Error::last_os_error();
|
||||
panic!("mmap failed for file {}: {}", file_path, errno);
|
||||
panic!("mmap failed for file {file_path}: {errno}");
|
||||
}
|
||||
|
||||
Self {
|
||||
|
||||
@@ -80,7 +80,7 @@ fn main() -> anyhow::Result<()> {
|
||||
});
|
||||
|
||||
println!("mode = {}", args.mode);
|
||||
println!("seed = {}", seed);
|
||||
println!("seed = {seed}");
|
||||
|
||||
let mut rng = ChaCha8Rng::seed_from_u64(seed);
|
||||
|
||||
@@ -266,7 +266,7 @@ fn create_initial_schema(rng: &mut ChaCha8Rng) -> Vec<Create> {
|
||||
let num_tables = rng.random_range(1..=5);
|
||||
|
||||
for i in 0..num_tables {
|
||||
let table_name = format!("table_{}", i);
|
||||
let table_name = format!("table_{i}");
|
||||
|
||||
// Generate random number of columns (2-8)
|
||||
let num_columns = rng.random_range(2..=8);
|
||||
@@ -289,7 +289,7 @@ fn create_initial_schema(rng: &mut ChaCha8Rng) -> Vec<Create> {
|
||||
};
|
||||
|
||||
columns.push(Column {
|
||||
name: format!("col_{}", j),
|
||||
name: format!("col_{j}"),
|
||||
column_type: col_type,
|
||||
primary: false,
|
||||
unique: rng.random_bool(0.2), // 20% chance of unique
|
||||
@@ -402,7 +402,7 @@ fn perform_work(
|
||||
let select = Select::arbitrary(rng, context);
|
||||
if let Ok(stmt) = context.fibers[fiber_idx]
|
||||
.connection
|
||||
.prepare(&select.to_string())
|
||||
.prepare(select.to_string())
|
||||
{
|
||||
context.fibers[fiber_idx].statement.replace(Some(stmt));
|
||||
}
|
||||
@@ -413,7 +413,7 @@ fn perform_work(
|
||||
let insert = Insert::arbitrary(rng, context);
|
||||
if let Ok(stmt) = context.fibers[fiber_idx]
|
||||
.connection
|
||||
.prepare(&insert.to_string())
|
||||
.prepare(insert.to_string())
|
||||
{
|
||||
context.fibers[fiber_idx].statement.replace(Some(stmt));
|
||||
context.stats.inserts += 1;
|
||||
@@ -425,7 +425,7 @@ fn perform_work(
|
||||
let update = Update::arbitrary(rng, context);
|
||||
if let Ok(stmt) = context.fibers[fiber_idx]
|
||||
.connection
|
||||
.prepare(&update.to_string())
|
||||
.prepare(update.to_string())
|
||||
{
|
||||
context.fibers[fiber_idx].statement.replace(Some(stmt));
|
||||
context.stats.updates += 1;
|
||||
@@ -437,7 +437,7 @@ fn perform_work(
|
||||
let delete = Delete::arbitrary(rng, context);
|
||||
if let Ok(stmt) = context.fibers[fiber_idx]
|
||||
.connection
|
||||
.prepare(&delete.to_string())
|
||||
.prepare(delete.to_string())
|
||||
{
|
||||
context.fibers[fiber_idx].statement.replace(Some(stmt));
|
||||
context.stats.deletes += 1;
|
||||
|
||||
Reference in New Issue
Block a user