fix: Remove needless borrow. Thanks clippy!

pull/24376/head
Carol (Nichols || Goulding) 2022-12-15 16:16:57 -05:00
parent a672fea405
commit 72aab99951
No known key found for this signature in database
GPG Key ID: E907EE5A736F87D4
13 changed files with 34 additions and 34 deletions

View File

@ -100,7 +100,7 @@ fn create_table(results: &[RecordBatch]) -> Result<Table> {
let mut cells = Vec::new();
for col in 0..batch.num_columns() {
let column = batch.column(col);
cells.push(Cell::new(&array_value_to_string(column, row)?));
cells.push(Cell::new(array_value_to_string(column, row)?));
}
table.add_row(cells);
}

View File

@ -58,7 +58,7 @@ mod tests {
)
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client
.create_bucket(Some(PostBucketRequest::new(org_id, bucket)))

View File

@ -43,7 +43,7 @@ mod tests {
async fn health() {
let mock_server = mock("GET", "/health").create();
let client = Client::new(&mockito::server_url(), "");
let client = Client::new(mockito::server_url(), "");
let _result = client.health().await;

View File

@ -151,7 +151,7 @@ mod tests {
.match_header("Authorization", format!("Token {}", token).as_str())
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.labels().await;
@ -167,7 +167,7 @@ mod tests {
.match_header("Authorization", format!("Token {}", token).as_str())
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.labels_by_org(org_id).await;
@ -183,7 +183,7 @@ mod tests {
.match_header("Authorization", format!("Token {}", token).as_str())
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.find_label(label_id).await;
@ -210,7 +210,7 @@ mod tests {
)
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.create_label(org_id, name, Some(properties)).await;
@ -229,7 +229,7 @@ mod tests {
.match_body(format!(r#"{{"orgID":"{}","name":"{}"}}"#, org_id, name).as_str())
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.create_label(org_id, name, None).await;
@ -256,7 +256,7 @@ mod tests {
)
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client
.update_label(Some(name.to_string()), Some(properties), label_id)
@ -276,7 +276,7 @@ mod tests {
.match_body("{}")
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.update_label(None, None, label_id).await;
@ -292,7 +292,7 @@ mod tests {
.match_header("Authorization", format!("Token {}", token).as_str())
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.delete_label(label_id).await;

View File

@ -158,7 +158,7 @@ mod tests {
.match_header("Authorization", format!("Token {}", token).as_str())
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.query_suggestions().await;
@ -181,7 +181,7 @@ mod tests {
.match_header("Authorization", format!("Token {}", token).as_str())
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.query_suggestions_name(suggestion_name).await;
@ -205,7 +205,7 @@ mod tests {
)
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.query_raw(org, query).await;
@ -230,7 +230,7 @@ mod tests {
)
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.query_raw(org, None).await;
@ -251,7 +251,7 @@ mod tests {
)
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.query_analyze(query).await;
@ -272,7 +272,7 @@ mod tests {
)
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.query_analyze(query).await;
@ -294,7 +294,7 @@ mod tests {
)
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.query_ast(language_request).await;
@ -315,7 +315,7 @@ mod tests {
)
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client.query_ast(language_request).await;
@ -340,7 +340,7 @@ mod tests {
.with_body("")
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let result = client.query_raw(org, query).await.expect("request success");
assert_eq!(result, "");

View File

@ -37,7 +37,7 @@ mod tests {
async fn ready() {
let mock_server = mock("GET", "/ready").create();
let client = Client::new(&mockito::server_url(), "");
let client = Client::new(mockito::server_url(), "");
let _result = client.ready().await;

View File

@ -123,7 +123,7 @@ mod tests {
async fn is_onboarding_allowed() {
let mock_server = mock("GET", "/api/v2/setup").create();
let client = Client::new(&mockito::server_url(), "");
let client = Client::new(mockito::server_url(), "");
let _result = client.is_onboarding_allowed().await;
@ -149,7 +149,7 @@ mod tests {
)
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client
.onboarding(
@ -185,7 +185,7 @@ mod tests {
)
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client
.post_setup_user(
@ -218,7 +218,7 @@ mod tests {
)
.create();
let client = Client::new(&mockito::server_url(), "");
let client = Client::new(mockito::server_url(), "");
let _result = client
.onboarding(username, org, bucket, None, None, None)
@ -246,7 +246,7 @@ mod tests {
)
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let _result = client
.post_setup_user(username, org, bucket, None, None, None)

View File

@ -85,7 +85,7 @@ cpu,host=server01,region=us-west usage=0.87
)
.create();
let client = Client::new(&mockito::server_url(), token);
let client = Client::new(mockito::server_url(), token);
let points = vec![
DataPoint::builder("cpu")

View File

@ -401,7 +401,7 @@ async fn new_pool(
options: &PostgresConnectionOptions,
) -> Result<HotSwapPool<Postgres>, sqlx::Error> {
let parsed_dsn = match get_dsn_file_path(&options.dsn) {
Some(filename) => std::fs::read_to_string(&filename)?,
Some(filename) => std::fs::read_to_string(filename)?,
None => options.dsn.clone(),
};
let pool = HotSwapPool::new(new_raw_pool(options, &parsed_dsn).await?);

View File

@ -301,7 +301,7 @@ pub struct IoxMetadata {
impl IoxMetadata {
/// Convert to base64 encoded protobuf format
pub fn to_base64(&self) -> std::result::Result<String, prost::EncodeError> {
Ok(base64::encode(&self.to_protobuf()?))
Ok(base64::encode(self.to_protobuf()?))
}
/// Read from base64 encoded protobuf format

View File

@ -653,7 +653,7 @@ SELECT * from cpu ORDER BY time DESC;
std::fs::create_dir(&in_dir).expect("create in-dir");
let out_dir = dir.path().join("out");
std::fs::create_dir(&out_dir).expect("create out-dir");
std::fs::create_dir(out_dir).expect("create out-dir");
let mut file = in_dir;
file.push("foo.sql");

View File

@ -280,7 +280,7 @@ impl TestConfig {
"INFLUXDB_IOX_WRITE_BUFFER_AUTO_CREATE_TOPICS",
n_shards.to_string(),
)
.with_env("INFLUXDB_IOX_WRITE_BUFFER_ADDR", &write_buffer_string)
.with_env("INFLUXDB_IOX_WRITE_BUFFER_ADDR", write_buffer_string)
}
/// Configures this TestConfig to use the same write buffer as other
@ -307,7 +307,7 @@ impl TestConfig {
let wal_string = tmpdir.path().display().to_string();
self.wal_dir = Some(Arc::new(tmpdir));
self.with_env("INFLUXDB_IOX_WAL_DIRECTORY", &wal_string)
self.with_env("INFLUXDB_IOX_WAL_DIRECTORY", wal_string)
}
/// Configures a new object store
@ -317,7 +317,7 @@ impl TestConfig {
let object_store_string = tmpdir.path().display().to_string();
self.object_store_dir = Some(Arc::new(tmpdir));
self.with_env("INFLUXDB_IOX_OBJECT_STORE", "file")
.with_env("INFLUXDB_IOX_DB_DIR", &object_store_string)
.with_env("INFLUXDB_IOX_DB_DIR", object_store_string)
}
/// Configures this TestConfig to use the same object store as other

View File

@ -296,7 +296,7 @@ impl Wal {
/// Open a reader to a closed segment
pub fn reader_for_segment(&self, id: SegmentId) -> Result<ClosedSegmentFileReader> {
let path = build_segment_path(&self.root, id);
ClosedSegmentFileReader::from_path(&path)
ClosedSegmentFileReader::from_path(path)
}
/// Writes one [`SequencedWalOp`] to the buffer and returns a watch channel for when the buffer