Skip to content

Commit 7aa8d9a

Browse files
committed
fix(deps): remove use of arcstr
1 parent ce57c2f commit 7aa8d9a

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

Cargo.lock

-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ edition = "2021"
88
[dependencies]
99
aho-corasick = "1.1.2"
1010
anyhow = "1.0.75"
11-
arcstr = { version = "1.1.5", default-features = false }
1211
clap-verbosity-flag = "2.0.1"
1312
flate2 = "1.0.28"
1413
futures-util = "0.3.28"

src/influxdb.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::io::Write;
2+
use std::sync::Arc;
23

3-
use arcstr::ArcStr;
44
use clap::Args;
55
use flate2::write::GzEncoder;
66
use reqwest::{header, Client as HttpClient};
@@ -42,18 +42,18 @@ struct WriteResponse {
4242
#[derive(Clone)]
4343
pub(crate) struct Client {
4444
url: Url,
45-
bucket: ArcStr,
46-
org: ArcStr,
47-
auth_header: ArcStr,
45+
bucket: Arc<str>,
46+
org: Arc<str>,
47+
auth_header: Arc<str>,
4848
http_client: HttpClient,
4949
}
5050

5151
impl Client {
5252
pub(crate) fn new(config: &Config) -> Self {
5353
let url = config.influxdb_url.clone();
54-
let bucket = ArcStr::from(&config.influxdb_bucket);
55-
let org = ArcStr::from(&config.influxdb_org);
56-
let auth_header = ArcStr::from(format!("Token {}", config.influxdb_api_token));
54+
let bucket = Arc::from(config.influxdb_bucket.as_str());
55+
let org = Arc::from(config.influxdb_org.as_str());
56+
let auth_header = Arc::from(format!("Token {}", config.influxdb_api_token).as_str());
5757
let http_client = HttpClient::new();
5858

5959
Self {
@@ -89,7 +89,7 @@ impl Client {
8989
let resp = self
9090
.http_client
9191
.post(url)
92-
.header(header::AUTHORIZATION, self.auth_header.as_str())
92+
.header(header::AUTHORIZATION, self.auth_header.as_ref())
9393
.header(header::CONTENT_ENCODING, "gzip")
9494
.header(header::CONTENT_TYPE, "text/plain; charset=utf-8")
9595
.body(body)

0 commit comments

Comments
 (0)