[PATCH 2 of 2 V4] rust: rustlazyancestors.__contains__

Yuya Nishihara yuya at tcha.org
Sun Oct 14 11:42:48 EDT 2018


On Sun, 14 Oct 2018 15:22:07 +0200, Georges Racinet wrote:
> # HG changeset patch
> # User Georges Racinet <gracinet at anybox.fr>
> # Date 1539018701 -7200
> #      Mon Oct 08 19:11:41 2018 +0200
> # Node ID 50d03c9079ffe3932955353be076ff24c4e87804
> # Parent  c04176c0f8b9aeaf196bd1eac00207d526f3d53b
> # EXP-Topic rustancestors-contains
> rust: rustlazyancestors.__contains__

> +static int rustla_contains(rustlazyancestorsObject *self, PyObject *rev) {
> +  if (!(PyInt_Check(rev))) {
> +    return 0;
> +  }
> +  return rustlazyancestors_contains(self->iter, PyInt_AS_LONG(rev));
> +}

Need tabs ;)

> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/rust/hg-direct-ffi/rustfmt.toml	Mon Oct 08 19:11:41 2018 +0200
> @@ -0,0 +1,3 @@
> +max_width = 79
> +wrap_comments = true
> +error_on_line_overflow = true

Can you send a separate patch for this?

> +int rustlazyancestors_contains(rustlazyancestorsObject *self, long rev);

> +#[no_mangle]
> +pub extern "C" fn rustlazyancestors_contains(
> +    raw: *mut AncestorsIterator<Index>,
> +    target: c_long,
> +) -> c_long {
> +    raw_contains(raw, target)
> +}

s/-> c_long/-> c_int/


More information about the Mercurial-devel mailing list