summaryrefslogtreecommitdiff
path: root/profcollectd
diff options
context:
space:
mode:
authorChris Wailes <chriswailes@google.com>2021-07-27 16:04:09 -0700
committerChris Wailes <chriswailes@google.com>2021-07-29 21:29:25 -0700
commit8f571e16cb0775d7b9b187a703c513541cfe528a (patch)
treee6818f61a6017217910a98502c8378bd1ae2fb54 /profcollectd
parent00d22924b6eba229d48fd503b077d447750dd1ed (diff)
downloadextras-8f571e16cb0775d7b9b187a703c513541cfe528a.tar.gz
Fix warnings in preparation for Rust 1.54.0
This CL fixes several new warnings generated by rustc 1.54.0. Bug: 194812675 Test: m rust Change-Id: I5877371b85ca3c447dc1fe53986827266b1b79c8
Diffstat (limited to 'profcollectd')
-rw-r--r--profcollectd/libprofcollectd/config.rs8
-rw-r--r--profcollectd/libprofcollectd/lib.rs4
-rw-r--r--profcollectd/libprofcollectd/report.rs2
-rw-r--r--profcollectd/libprofcollectd/service.rs4
4 files changed, 9 insertions, 9 deletions
diff --git a/profcollectd/libprofcollectd/config.rs b/profcollectd/libprofcollectd/config.rs
index bc41e99e..d5359956 100644
--- a/profcollectd/libprofcollectd/config.rs
+++ b/profcollectd/libprofcollectd/config.rs
@@ -88,10 +88,10 @@ impl FromStr for Config {
}
fn get_or_initialise_node_id() -> Result<MacAddr6> {
- let mut node_id = get_property(&PROFCOLLECT_NODE_ID_PROPERTY, MacAddr6::nil())?;
+ let mut node_id = get_property(PROFCOLLECT_NODE_ID_PROPERTY, MacAddr6::nil())?;
if node_id.is_nil() {
node_id = generate_random_node_id();
- set_property(&PROFCOLLECT_NODE_ID_PROPERTY, node_id)?;
+ set_property(PROFCOLLECT_NODE_ID_PROPERTY, node_id)?;
}
Ok(node_id)
@@ -108,8 +108,8 @@ where
{
let default_value = default_value.to_string();
let config = profcollect_libflags_rust::GetServerConfigurableFlag(
- &PROFCOLLECT_CONFIG_NAMESPACE,
- &key,
+ PROFCOLLECT_CONFIG_NAMESPACE,
+ key,
&default_value,
);
Ok(T::from_str(&config)?)
diff --git a/profcollectd/libprofcollectd/lib.rs b/profcollectd/libprofcollectd/lib.rs
index f417bd8c..d5eec68c 100644
--- a/profcollectd/libprofcollectd/lib.rs
+++ b/profcollectd/libprofcollectd/lib.rs
@@ -42,7 +42,7 @@ pub fn init_service(schedule_now: bool) -> Result<()> {
let profcollect_binder_service = ProfcollectdBinderService::new()?;
binder::add_service(
- &PROFCOLLECTD_SERVICE_NAME,
+ PROFCOLLECTD_SERVICE_NAME,
BnProfCollectd::new_binder(profcollect_binder_service, BinderFeatures::default())
.as_binder(),
)
@@ -58,7 +58,7 @@ pub fn init_service(schedule_now: bool) -> Result<()> {
}
fn get_profcollectd_service() -> Result<binder::Strong<dyn IProfCollectd::IProfCollectd>> {
- binder::get_interface(&PROFCOLLECTD_SERVICE_NAME)
+ binder::get_interface(PROFCOLLECTD_SERVICE_NAME)
.context("Failed to get profcollectd binder service, is profcollectd running?")
}
diff --git a/profcollectd/libprofcollectd/report.rs b/profcollectd/libprofcollectd/report.rs
index a67d500b..69dff0c6 100644
--- a/profcollectd/libprofcollectd/report.rs
+++ b/profcollectd/libprofcollectd/report.rs
@@ -79,7 +79,7 @@ fn get_report_filename(node_id: &MacAddr6) -> Result<String> {
let since_epoch = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH)?;
let ts =
Timestamp::from_unix(&*UUID_CONTEXT, since_epoch.as_secs(), since_epoch.subsec_nanos());
- let uuid = Uuid::new_v1(ts, &node_id.as_bytes())?;
+ let uuid = Uuid::new_v1(ts, node_id.as_bytes())?;
Ok(uuid.to_string())
}
diff --git a/profcollectd/libprofcollectd/service.rs b/profcollectd/libprofcollectd/service.rs
index 04f30f89..021271f3 100644
--- a/profcollectd/libprofcollectd/service.rs
+++ b/profcollectd/libprofcollectd/service.rs
@@ -89,7 +89,7 @@ impl IProfCollectd for ProfcollectdBinderService {
.map_err(err_to_binder_status)
}
fn delete_report(&self, report_name: &str) -> BinderResult<()> {
- verify_report_name(&report_name).map_err(err_to_binder_status)?;
+ verify_report_name(report_name).map_err(err_to_binder_status)?;
let mut report = PathBuf::from(&*REPORT_OUTPUT_DIR);
report.push(report_name);
@@ -101,7 +101,7 @@ impl IProfCollectd for ProfcollectdBinderService {
if bb_profile_id < 0 {
return Err(err_to_binder_status(anyhow!("Invalid profile ID")));
}
- verify_report_name(&report_name).map_err(err_to_binder_status)?;
+ verify_report_name(report_name).map_err(err_to_binder_status)?;
let mut report = PathBuf::from(&*REPORT_OUTPUT_DIR);
report.push(report_name);