Skip to content

Commit 743c0ca

Browse files
committed
fix(example): pass &str to get_identity_flags (#6)
1 parent c79affd commit 743c0ca

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

example/src/main.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ fn default_flag_handler(feature_name: &str) -> Flag {
3131
return flag;
3232
}
3333

34-
use std::{thread, time::Duration};
3534
#[get("/?<identifier>&<trait_key>&<trait_value>")]
3635
fn home(
3736
identifier: Option<String>,
@@ -44,7 +43,11 @@ fn home(
4443
..Default::default()
4544
};
4645

47-
let flagsmith = Flagsmith::new(env::var("FLAGSMITH_ENVIRONMENT_KEY").expect("FLAGSMITH_ENVIRONMENT_KEY not found in environment"), options);
46+
let flagsmith = Flagsmith::new(
47+
env::var("FLAGSMITH_ENVIRONMENT_KEY")
48+
.expect("FLAGSMITH_ENVIRONMENT_KEY not found in environment"),
49+
options,
50+
);
4851
let flags;
4952
if identifier.is_some() {
5053
let traits = match trait_key {
@@ -59,7 +62,7 @@ fn home(
5962
None => None,
6063
};
6164
flags = flagsmith
62-
.get_identity_flags(identifier.as_ref().unwrap().to_string(), traits)
65+
.get_identity_flags(identifier.as_ref().unwrap(), traits)
6366
.unwrap();
6467
} else {
6568
// Get the default flags for the current environment

0 commit comments

Comments
 (0)