我可以使用fn split_filter<T: Clone, F>(a: &[T], f: F) -> (Vec<T>, Vec<T>)
where
F: Fn(&T) -> bool,
{
let mut i: Vec<T> = vec![];
let mut e: Vec<T> = vec![];
for u in a.iter().cloned() {
if f(&u) {
i.push(u);
} else {
e.push(u);
}
}
return (i, e);
}
fn main() {
let v = vec![10, 40, 30, 20, 60, 50];
println!("{:?}", split_filter(&v, |&a| a % 3 == 0));
}
在本地计算机上运行测试但是
无法使用Selenium在远程计算机上运行测试。
IWebDriver
我得到的错误是
DesiredCapabilities capability = new DesiredCapabilities();
capability.SetCapability(CapabilityType.BrowserName, DesiredCapabilities.InternetExplorer());
capability.SetCapability(CapabilityType.Platform, new Platform(PlatformType.Windows));
capability.SetCapability("webdriver.ie.driver", @"E:\WebDriver\Browser\");
string host = "localhost:4444/wd/hub";
RemoteWebDriver driver = new RemoteWebDriver(new Uri("http://" + host), capability);