Skip to content

Commit

Permalink
chore(build): Address beta lint warning and suggestions (#3168)
Browse files Browse the repository at this point in the history
Fixing beta lint warning making sure new Rust release will be just
working in Relay codebase.

Also updating `uuid` to the newest version to address some of the errors
while using `beta`.
  • Loading branch information
olksdr authored Feb 27, 2024
1 parent 99c340b commit dc6ece7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ smallvec = { version = "1.11.2", features = ["serde"] }
thiserror = "1.0.38"
tokio = { version = "1.28.0", features = ["macros", "sync", "tracing"] }
url = "2.1.1"
uuid = { version = "1.3.0", features = ["serde", "v4"] }
uuid = { version = "1.7.0", features = ["serde", "v4"] }
2 changes: 1 addition & 1 deletion relay-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ use std::{fmt, panic, thread};
pub use relay_ffi_macros::catch_unwind;

thread_local! {
static LAST_ERROR: RefCell<Option<anyhow::Error>> = RefCell::new(None);
static LAST_ERROR: RefCell<Option<anyhow::Error>> = const { RefCell::new(None) };
}

fn set_last_error(err: anyhow::Error) {
Expand Down
2 changes: 1 addition & 1 deletion relay-server/src/services/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ impl EnvelopeProcessorService {
&self,
state: &mut ProcessEnvelopeState<G>,
) -> Result<(), ProcessingError> {
if let Some(sampling_state) = state.sampling_project_state.as_ref().map(Arc::clone) {
if let Some(sampling_state) = state.sampling_project_state.clone() {
state
.envelope_mut()
.parametrize_dsc_transaction(&sampling_state.config.tx_name_rules);
Expand Down
8 changes: 4 additions & 4 deletions relay-server/src/utils/dynamic_sampling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ mod tests {
/// Tests that an event is kept when there is a match and we have 100% sample rate.
fn test_match_rules_return_keep_with_match_and_100_sample_rate() {
let event = mocked_event(EventType::Transaction, "bar", "2.0");
let rules = vec![mocked_sampling_rule(1, RuleType::Transaction, 1.0)];
let rules = [mocked_sampling_rule(1, RuleType::Transaction, 1.0)];
let seed = Uuid::default();

let result: SamplingResult = SamplingEvaluator::new(Utc::now())
Expand All @@ -214,7 +214,7 @@ mod tests {
/// Tests that an event is dropped when there is a match and we have 0% sample rate.
fn test_match_rules_return_drop_with_match_and_0_sample_rate() {
let event = mocked_event(EventType::Transaction, "bar", "2.0");
let rules = vec![mocked_sampling_rule(1, RuleType::Transaction, 0.0)];
let rules = [mocked_sampling_rule(1, RuleType::Transaction, 0.0)];
let seed = Uuid::default();

let result: SamplingResult = SamplingEvaluator::new(Utc::now())
Expand All @@ -228,7 +228,7 @@ mod tests {
#[test]
/// Tests that an event is kept when there is no match.
fn test_match_rules_return_keep_with_no_match() {
let rules = vec![SamplingRule {
let rules = [SamplingRule {
condition: RuleCondition::eq_ignore_case("event.transaction", "foo"),
sampling_value: SamplingValue::SampleRate { value: 0.5 },
ty: RuleType::Transaction,
Expand All @@ -251,7 +251,7 @@ mod tests {
#[test]
/// Tests that an event is kept when there is a trace match and we have 100% sample rate.
fn test_match_rules_with_traces_rules_return_keep_when_match() {
let rules = vec![mocked_sampling_rule(1, RuleType::Trace, 1.0)];
let rules = [mocked_sampling_rule(1, RuleType::Trace, 1.0)];
let dsc = mocked_simple_dynamic_sampling_context(Some(1.0), Some("3.0"), None, None, None);

let result: SamplingResult = SamplingEvaluator::new(Utc::now())
Expand Down

0 comments on commit dc6ece7

Please sign in to comment.