Skip to content

Commit

Permalink
Use to_string() for &str values
Browse files Browse the repository at this point in the history
  • Loading branch information
tmarkovski authored and fundthmcalculus committed May 19, 2022
1 parent f0c7f6a commit 2971477
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions native/src/metadata/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ use crate::didcomm::Error;
use crate::proto::okapi::okapi_metadata::{MetadataRequest, MetadataResponse};

impl crate::Metadata {
pub fn get_metadata<'a>(request: &MetadataRequest) -> Result<MetadataResponse, Error<'a>> {
pub fn get_metadata<'a>(_request: &MetadataRequest) -> Result<MetadataResponse, Error<'a>> {
Ok(MetadataResponse {
version: option_env!("CARGO_PKG_VERSION").unwrap_or_default().parse().unwrap_or_default(),
version: option_env!("CARGO_PKG_VERSION").unwrap_or_default().to_string(),
version_major: option_env!("CARGO_PKG_VERSION_MAJOR").unwrap_or_default().parse().unwrap_or_default(),
version_minor: option_env!("CARGO_PKG_VERSION_MINOR").unwrap_or_default().parse().unwrap_or_default(),
version_patch: option_env!("CARGO_PKG_VERSION_PATCH").unwrap_or_default().parse().unwrap_or_default(),

target_family: option_env!("CARGO_CFG_TARGET_FAMILY").unwrap_or_default().parse().unwrap_or_default(),
target_os: option_env!("CARGO_CFG_TARGET_os").unwrap_or_default().parse().unwrap_or_default(),
target_arch: option_env!("CARGO_CFG_TARGET_arch").unwrap_or_default().parse().unwrap_or_default(),
target_vendor: option_env!("CARGO_CFG_TARGET_VENDOR").unwrap_or_default().parse().unwrap_or_default(),
target_env: option_env!("CARGO_CFG_TARGET_ENV").unwrap_or_default().parse().unwrap_or_default(),
target_family: option_env!("CARGO_CFG_TARGET_FAMILY").unwrap_or_default().to_string(),
target_os: option_env!("CARGO_CFG_TARGET_OS").unwrap_or_default().to_string(),
target_arch: option_env!("CARGO_CFG_TARGET_ARCH").unwrap_or_default().to_string(),
target_vendor: option_env!("CARGO_CFG_TARGET_VENDOR").unwrap_or_default().to_string(),
target_env: option_env!("CARGO_CFG_TARGET_ENV").unwrap_or_default().to_string(),
})
}
}

0 comments on commit 2971477

Please sign in to comment.