Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dev-tools/ls-apis/src/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ impl Workspace {
the workspace root ({:?})",
self.name,
pkgname,
&self.workspace_root,
self.workspace_root,
)
})?;
let path = cargo_toml_parent(&relative_path, &manifest_path)?;
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/ls-apis/src/workspaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ fn load_dependent_repo(
format!(
"locating workspace for {:?} (from {:?}) with \
`cargo locate-project`",
pkgname, &pkg.manifest_path
pkgname, pkg.manifest_path
)
})?;
let workspace_manifest = Utf8Path::new(output.trim_end());
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/omdb/src/bin/omdb/clickhouse_admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl ClickHouseAdminArgs {
};
eprintln!(
"note: using {}clickhouse-admin URL {}",
maybe_replicated, &server_url
maybe_replicated, server_url
);

let client = Client::new(
Expand Down
4 changes: 2 additions & 2 deletions dev-tools/omdb/src/bin/omdb/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ impl DbUrlOptions {
log: &slog::Logger,
) -> anyhow::Result<Arc<DataStore>> {
let db_url = self.resolve_pg_url(omdb, log).await?;
eprintln!("note: using database URL {}", &db_url);
eprintln!("note: using database URL {}", db_url);

let addrs = db_url.all_addresses()?;
let pool = Arc::new(db::Pool::new_fixed_hosts(log, addrs));
Expand Down Expand Up @@ -6571,7 +6571,7 @@ async fn cmd_db_validate_volume_references(
// full table scan
conn.batch_execute_async(ALLOW_FULL_TABLE_SCAN_SQL).await?;

let pattern = format!("%{}%", &snapshot_addr);
let pattern = format!("%{}%", snapshot_addr);

use nexus_db_schema::schema::volume::dsl;

Expand Down
4 changes: 2 additions & 2 deletions dev-tools/omdb/src/bin/omdb/mgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl MgsArgs {
format!("http://{}", addr)
}
};
eprintln!("note: using MGS URL {}", &mgs_url);
eprintln!("note: using MGS URL {}", mgs_url);
Ok(gateway_client::Client::new(&mgs_url, log.clone()))
}

Expand Down Expand Up @@ -584,7 +584,7 @@ async fn show_sp_details(
format!(
"get caboose for sp type {:?} sp slot {} \
component {:?} slot {}",
sp_id.typ, sp_id.slot, &c.component, i
sp_id.typ, sp_id.slot, c.component, i
)
});
match r {
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/omdb/src/bin/omdb/mgs/sensors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ fn sp_info_csv<R: std::io::Read>(
if &headers[ndx] != expected[ndx] {
bail!(
"malformed headers: expected {}, found {} ({headers:?})",
&expected[ndx],
expected[ndx],
&headers[ndx]
);
}
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/omdb/src/bin/omdb/nexus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ impl NexusArgs {
format!("http://{}", addr)
}
};
eprintln!("note: using Nexus URL {}", &nexus_url);
eprintln!("note: using Nexus URL {}", nexus_url);
let client =
nexus_lockstep_client::Client::new(&nexus_url, log.clone());

Expand Down
2 changes: 1 addition & 1 deletion dev-tools/omdb/src/bin/omdb/oximeter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl OximeterArgs {
format!("http://{}", addr)
}
};
eprintln!("note: using Oximeter URL {}", &oximeter_url);
eprintln!("note: using Oximeter URL {}", oximeter_url);

let client = Client::new(
&oximeter_url,
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/omicron-dev-lib/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn verify_graceful_exit(
.wait_timeout(TIMEOUT)
.expect("failed to wait for process to exit")
.unwrap_or_else(|| {
panic!("timed out waiting {:?} for process to exit", &TIMEOUT)
panic!("timed out waiting {:?} for process to exit", TIMEOUT)
});

assert!(!process_running(cmd_pid));
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/reconfigurator-exec-unsafe/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl ReconfiguratorExec {
.with_context(|| format!("open {:?}", input_path))?;
let bufread = std::io::BufReader::new(file);
let blueprint: Blueprint = serde_json::from_reader(bufread)
.with_context(|| format!("read and parse {:?}", &input_path))?;
.with_context(|| format!("read and parse {:?}", input_path))?;

// Check that the blueprint is the current system target.
// (This is currently redundant with a check done early during blueprint
Expand Down
6 changes: 3 additions & 3 deletions dev-tools/repl-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ pub fn run_repl_from_file<C: Parser>(
run_one: &mut dyn FnMut(C) -> anyhow::Result<Option<String>>,
) -> anyhow::Result<()> {
let file = File::open(&input_file)
.with_context(|| format!("open {:?}", &input_file))?;
.with_context(|| format!("open {:?}", input_file))?;
let bufread = BufReader::new(file);
let mut lines = bufread.lines().peekable();
while let Some(line_res) = lines.next() {
let line =
line_res.with_context(|| format!("read {:?}", &input_file))?;
line_res.with_context(|| format!("read {:?}", input_file))?;

// Extract and handle multi-line comments.
if line.starts_with('#') {
Expand All @@ -56,7 +56,7 @@ pub fn run_repl_from_file<C: Parser>(
break;
};
let next_line = next_res
.with_context(|| format!("read {:?}", &input_file))?;
.with_context(|| format!("read {:?}", input_file))?;
println!("> {}", next_line);
}

Expand Down
2 changes: 1 addition & 1 deletion dev-tools/schema/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ fn generate_base_schema(commit_or_tag: &str) -> Result<()> {
// Resolve the commit/tag to a full commit hash
let commit_hash =
resolve_commit_or_tag(workspace_root.as_ref(), commit_or_tag)?;
println!("Resolved {} to commit {}", commit_or_tag, &commit_hash);
println!("Resolved {} to commit {}", commit_or_tag, commit_hash);

// Get the dbinit.sql content from that commit
let dbinit_content = get_dbinit_from_commit(&workspace_root, &commit_hash)?;
Expand Down
8 changes: 4 additions & 4 deletions dev-tools/xtask/src/live_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn run_cmd(_args: Args) -> Result<()> {
eprintln!();

std::fs::create_dir(&proto_root)
.with_context(|| format!("mkdir {:?}", &proto_root))?;
.with_context(|| format!("mkdir {:?}", proto_root))?;

let mut command = cargo_command(CargoLocation::FromEnv);

Expand Down Expand Up @@ -80,7 +80,7 @@ pub fn run_cmd(_args: Args) -> Result<()> {
command.arg(format!(
"tar cf - Cargo.toml .config/nextest.toml live-tests | \
tar xf - -C {:?}",
&proto_root
proto_root
));
run_subcmd(command)?;

Expand All @@ -95,14 +95,14 @@ pub fn run_cmd(_args: Args) -> Result<()> {
drop(tmpdir_root);

eprint!("created: ");
println!("{}", &final_tarball);
println!("{}", final_tarball);
eprintln!("\nTo use this:\n");
eprintln!(
"1. Copy the tarball to the switch zone in a deployed Omicron system.\n"
);
let raw = &[
"scp \\",
&format!("{} \\", &final_tarball),
&format!("{} \\", final_tarball),
"root@YOUR_SCRIMLET_GZ_IP:/zone/oxz_switch/root/root",
]
.join("\n");
Expand Down
4 changes: 2 additions & 2 deletions dns-server/src/bin/dns-db-dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ fn main() -> Result<()> {
.path(&arg.storage_path)
.create_new(false)
.open()
.with_context(|| format!("open {:?}", &arg.storage_path))?;
.with_context(|| format!("open {:?}", arg.storage_path))?;

if !db.was_recovered() {
bail!(
"no database found at {:?} (sorry, this command likely just \
created an empty database there)",
&arg.storage_path
arg.storage_path
);
}

Expand Down
4 changes: 2 additions & 2 deletions dns-server/src/dns_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ fn dns_record_to_record(
let tgt = Name::from_str(&target).map_err(|error| {
RequestError::ServFail(anyhow!(
"serialization failed due to bad SRV target {:?}: {:#}",
&target,
target,
error
))
})?;
Expand All @@ -252,7 +252,7 @@ fn dns_record_to_record(
let nsdname = Name::from_str(&nsdname).map_err(|error| {
RequestError::ServFail(anyhow!(
"serialization failed due to bad NS dname {:?}: {:#}",
&nsdname,
nsdname,
error
))
})?;
Expand Down
4 changes: 2 additions & 2 deletions dns-server/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ impl Store {
);

let db = sled::open(&config.storage_path).with_context(|| {
format!("open DNS database {:?}", &config.storage_path)
format!("open DNS database {:?}", config.storage_path)
})?;

Self::new_with_db(log, Arc::new(db), config)
Expand Down Expand Up @@ -570,7 +570,7 @@ impl Store {
let tree = self
.db
.open_tree(&tree_name)
.with_context(|| format!("creating tree {:?}", &tree_name))?;
.with_context(|| format!("creating tree {:?}", tree_name))?;

for (name, records) in &zone_config.records {
if records.is_empty() {
Expand Down
4 changes: 2 additions & 2 deletions end-to-end-tests/src/helpers/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ impl ClientParams {
Err(_) => ("http", None),
Ok(path) => {
let cert_bytes = std::fs::read(&path).with_context(|| {
format!("reading certificate from {:?}", &path)
format!("reading certificate from {:?}", path)
})?;
let cert = reqwest::tls::Certificate::from_pem(&cert_bytes)
.with_context(|| {
format!("parsing certificate from {:?}", &path)
format!("parsing certificate from {:?}", path)
})?;
("https", Some(cert))
}
Expand Down
2 changes: 1 addition & 1 deletion nexus/auth/src/authz/oso_generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl OsoInitBuilder {
info!(self.log, "registering Oso class"; "class" => &c.name);
let name = c.name.clone();
let new_element = self.class_names.insert(name.clone());
ensure!(new_element, "Oso class was already registered: {:?}", &name);
ensure!(new_element, "Oso class was already registered: {:?}", name);
self.oso
.register_class(c)
.with_context(|| format!("registering Oso class {:?}", name))?;
Expand Down
2 changes: 1 addition & 1 deletion nexus/db-model/src/role_assignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ where
Error::internal_error(&format!(
"parsing database role assignment: \
unrecognized role name {:?}: {:#}",
&role_asgn.role_name, error,
role_asgn.role_name, error,
))
})?,
})
Expand Down
2 changes: 1 addition & 1 deletion nexus/db-queries/src/db/datastore/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ impl DnsVersionUpdateBuilder {
Err(Error::internal_error(&format!(
"DNS update ({:?}) attempted to remove name {:?} \
multiple times",
self.comment, &name,
self.comment, name,
)))
} else {
assert!(self.names_removed.insert(name));
Expand Down
2 changes: 1 addition & 1 deletion nexus/db-queries/src/db/datastore/identity_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl DataStore {
omicron_common::api::external::Error::internal_error(
&format!(
"saml_identity_provider.try_into() failed! {}",
&e.to_string()
e
)
)
)?
Expand Down
2 changes: 1 addition & 1 deletion nexus/db-queries/src/db/datastore/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5714,7 +5714,7 @@ mod test {
);
println!(
"all collections: {:?}\n",
&[
[
collection1.id,
collection2.id,
collection3.id,
Expand Down
2 changes: 1 addition & 1 deletion nexus/db-queries/src/db/datastore/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2424,7 +2424,7 @@ mod test {
name, description, project ID, and {} ID:\
{name:?} {description:?} {project_id:?} {:?}\n{e}",
if is_service { "Service" } else { "Instance" },
&ip.parent_id
ip.parent_id
)
});

Expand Down
2 changes: 1 addition & 1 deletion nexus/db-queries/src/policy_test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ async fn authorize_one_resource(

for ctx_tuple in user_contexts.iter() {
let (ref username, ref opctx) = **ctx_tuple;
write!(out, " {:32}", &username)?;
write!(out, " {:32}", username)?;
for action in authz::Action::iter() {
let result = resource.do_authorize(opctx, action).await;
trace!(
Expand Down
2 changes: 1 addition & 1 deletion nexus/db-queries/src/policy_test/resource_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl<'a> ResourceBuilder<'a> {
let role_name = role.to_database_string();
let username = format!("{}-{}", resource_name, role_name);
let user_id = SiloUserUuid::new_v4();
println!("creating user: {}", &username);
println!("creating user: {}", username);
self.users.push((username.clone(), user_id));

let authz_silo = authz::Silo::new(
Expand Down
6 changes: 3 additions & 3 deletions nexus/inventory/src/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ impl<'a> Collector<'a> {
);

let maybe_ident = client.inventory().await.with_context(|| {
format!("Sled Agent {:?}: inventory", &sled_agent_url)
format!("Sled Agent {:?}: inventory", sled_agent_url)
});
let inventory = match maybe_ident {
Ok(inventory) => inventory.into_inner(),
Expand Down Expand Up @@ -545,7 +545,7 @@ impl<'a> Collector<'a> {
);

let maybe_ident = client.timesync().await.with_context(|| {
format!("Sled Agent {:?}: timesync", &sled_agent_url)
format!("Sled Agent {:?}: timesync", sled_agent_url)
});
let timesync = match maybe_ident {
Ok(timesync) => nexus_types::inventory::TimeSync {
Expand Down Expand Up @@ -587,7 +587,7 @@ impl<'a> Collector<'a> {
);

let res = client.keeper_cluster_membership().await.with_context(|| {
format!("Clickhouse Keeper {:?}: inventory", &client.baseurl())
format!("Clickhouse Keeper {:?}: inventory", client.baseurl())
});

match res {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ async fn test_blueprint_edit(cptestctx: &ControlPlaneTestContext) {
);
swriteln!(s, "save {}", saved_state2_path);
std::fs::write(&script1_path, &s)
.with_context(|| format!("write {}", &script1_path))
.with_context(|| format!("write {}", script1_path))
.unwrap();

// Run this reconfigurator-cli invocation.
Expand Down Expand Up @@ -208,7 +208,7 @@ async fn test_blueprint_edit(cptestctx: &ControlPlaneTestContext) {
swriteln!(s, "load {} {}", saved_state2_path, collection.id);
swriteln!(s, "blueprint-save {} {}", new_blueprint.id, new_blueprint_path);
std::fs::write(&script2_path, &s)
.with_context(|| format!("write {}", &script2_path))
.with_context(|| format!("write {}", script2_path))
.unwrap();
let exec = Exec::cmd(path_to_cli()).arg(&script2_path);
let (exit_status, _, stderr_text) = run_command(exec);
Expand Down
2 changes: 1 addition & 1 deletion nexus/reconfigurator/planning/src/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1829,7 +1829,7 @@ mod tests {
}
};

eprintln!("*** qorb lookup successful: {:?}", &**backends);
eprintln!("*** qorb lookup successful: {:?}", **backends);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ mod test {
let result: ReadOnlyRegionReplacementStartStatus =
serde_json::from_value(task.activate(&opctx).await).unwrap();

eprintln!("{:?}", &result);
eprintln!("{:?}", result);

assert_eq!(result.requests_created_ok.len(), 1);
assert!(result.errors.is_empty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ mod test {
let result: RegionSnapshotReplacementStartStatus =
serde_json::from_value(task.activate(&opctx).await).unwrap();

eprintln!("{:?}", &result);
eprintln!("{:?}", result);

assert_eq!(result.requests_created_ok.len(), 1);
assert_eq!(result.start_invoked_ok.len(), 1);
Expand Down
Loading
Loading