Skip to content

Commit

Permalink
ref(relay): Fix rust beta lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav1dde committed Aug 12, 2024
1 parent a4fd614 commit fd264fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion relay-pii/src/attachments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ impl<'a> PiiAttachmentsProcessor<'a> {

/// Scrub a filepath, preserving the basename.
pub fn scrub_utf8_filepath(&self, path: &mut str, state: &ProcessingState<'_>) -> bool {
if let Some(index) = path.rfind(|c| c == '/' || c == '\\') {
if let Some(index) = path.rfind(['/', '\\']) {
let data = unsafe { &mut path.as_bytes_mut()[..index] };
self.scrub_bytes(data, state, ScrubEncodings::Utf8)
} else {
Expand Down
5 changes: 2 additions & 3 deletions relay-pii/src/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@ impl DataScrubbingConfig {
/// Like [`pii_config`](Self::pii_config) but without internal caching.
#[inline]
pub fn pii_config_uncached(&self) -> Result<Option<PiiConfig>, PiiConfigError> {
convert::to_pii_config(self).map_err(|e| {
convert::to_pii_config(self).inspect_err(|e| {
relay_log::error!(
error = &e as &dyn std::error::Error,
error = e as &dyn std::error::Error,
"failed to convert datascrubbing config"
);
e
})
}
}
2 changes: 1 addition & 1 deletion relay-pii/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl<'a> Processor for PiiProcessor<'a> {
// string. If we decide that we need to preserve anything other than suffixes all PII
// tooltips/annotations are potentially wrong.

if let Some(index) = value.rfind(|c| c == '/' || c == '\\') {
if let Some(index) = value.rfind(['/', '\\']) {
let basename = value.split_off(index);
match self.process_string(value, meta, state) {
Ok(()) => value.push_str(&basename),
Expand Down

0 comments on commit fd264fd

Please sign in to comment.