Skip to content

Commit

Permalink
Allow creating index using binary representation
Browse files Browse the repository at this point in the history
While building an alternative import tool for rethinkdb using Rust, I
found myself trying to create index using the binary representation, as
exported by the official export tool.

However, the current implementation always wrap everything in a `Func`
so that didn't work, this PR is an attempt to fix that.

There's probably a better way to do this, but I'm not sure how.
  • Loading branch information
kid committed Mar 3, 2023
1 parent b020521 commit a1b7269
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions reql/src/cmd/index_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ where
R: Into<Command>,
{
fn arg(self) -> cmd::Arg<Options> {
let Args((name, query)) = self;
let func = Func::row(query);
Args((name, func)).arg()
let Args((name, func)) = self;
name.arg().with_arg(func)
}
}

Expand Down Expand Up @@ -79,8 +78,7 @@ where
R: Into<Command>,
{
fn arg(self) -> cmd::Arg<Options> {
let Args((name, query, opts)) = self;
let Func(func) = Func::row(query);
let Args((name, func, opts)) = self;
name.arg().with_arg(func).with_opts(opts)
}
}

0 comments on commit a1b7269

Please sign in to comment.