Skip to content

Commit

Permalink
Merge "Fix warnings in preparation for Rust 1.54.0"
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswailes authored and Gerrit Code Review committed Aug 2, 2021
2 parents 6535e9f + 8f571e1 commit 7302051
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions profcollectd/libprofcollectd/config.rs
Expand Up @@ -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)
Expand All @@ -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)?)
Expand Down
4 changes: 2 additions & 2 deletions profcollectd/libprofcollectd/lib.rs
Expand Up @@ -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(),
)
Expand All @@ -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?")
}

Expand Down
2 changes: 1 addition & 1 deletion profcollectd/libprofcollectd/report.rs
Expand Up @@ -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())
}

Expand Down
4 changes: 2 additions & 2 deletions profcollectd/libprofcollectd/service.rs
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 7302051

Please sign in to comment.