Skip to content

Commit

Permalink
Work around rust-lang/rust#41297
Browse files Browse the repository at this point in the history
See in particular
rust-lang/rust#41297 (comment).
This change should be reverted once a fix for that issue lands.
  • Loading branch information
jonhoo committed Jun 30, 2017
1 parent c656730 commit 8454bf7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ pub struct Form {
}

impl Client {
// inline to work around https://github.com/rust-lang/rust/issues/41297#issuecomment-312197433
#[inline]
fn init(
mut self,
params: webdriver::command::NewSessionParameters,
Expand Down Expand Up @@ -428,6 +430,7 @@ impl Client {
)
}

#[inline]
fn dup(&self) -> Self {
Client(self.0.clone())
}
Expand All @@ -440,6 +443,7 @@ impl Client {
/// Helper for determining what URL endpoint to use for various requests.
///
/// This mapping is essentially that of https://www.w3.org/TR/webdriver/#list-of-endpoints.
#[inline]
fn endpoint_for(&self, cmd: &Cmd) -> Result<url::Url, url::ParseError> {
if let WebDriverCommand::NewSession(..) = *cmd {
return self.0.wdb.join("/session");
Expand Down Expand Up @@ -490,6 +494,7 @@ impl Client {
/// arguments (if any) into the body.
///
/// [the spec]: https://www.w3.org/TR/webdriver/#list-of-endpoints
#[inline]
fn issue_wd_cmd(
self,
cmd: WebDriverCommand<webdriver::command::VoidWebDriverExtensionCommand>,
Expand Down Expand Up @@ -741,6 +746,7 @@ impl Client {
.map(|(this, _)| this)
}

#[inline]
fn current_url_(
&self,
) -> impl Future<Item = (Self, url::Url), Error = error::CmdError> + 'static {
Expand Down Expand Up @@ -1025,6 +1031,7 @@ impl Client {

// helpers

#[inline]
fn by(
&self,
locator: webdriver::command::LocatorParameters,
Expand All @@ -1039,6 +1046,7 @@ impl Client {
}

/// Extract the `WebElement` from a `FindElement` or `FindElementElement` command.
#[inline]
fn parse_lookup(&self, res: Json) -> Result<webdriver::common::WebElement, error::CmdError> {
if !res.is_object() {
return Err(error::CmdError::NotW3C(res));
Expand Down Expand Up @@ -1069,6 +1077,7 @@ impl Client {
Err(error::CmdError::NotW3C(Json::Object(res)))
}

#[inline]
fn fixup_elements(&self, args: &mut [Json]) {
if self.0.legacy {
for arg in args {
Expand Down

0 comments on commit 8454bf7

Please sign in to comment.