Here is the function in python:
list1 = ["one", "two", "three", "four"]
list2 = ["three", "four"]
def tester():
for item in list1:
if item not in list2:
print(f"found! {item}")
Im just sorting through the list and finding the difference between the two. I'm trying to write this in rust for the speed
fn test() {
let mut list1 = vec!("one", "two", "three", "four");
let mut list2 = vec!("three", "four");
for item in list1 {
if item not in list2 { // This line is not happy
println!("{}", item)
}
}
}
I tried to do a similar thing In rust. I am wanting it to print out "one" & "two".
The problem that im having is that there seems to be no 'not' operator and 'in <iterable>' seems to not work. Tried looking at the docs and didn't see any mention of a 'not' type operator. Any help would be appreciated