Skip to content

Commit a1b7269

Browse files
committed
Allow creating index using binary representation
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.
1 parent b020521 commit a1b7269

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

reql/src/cmd/index_create.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ where
4747
R: Into<Command>,
4848
{
4949
fn arg(self) -> cmd::Arg<Options> {
50-
let Args((name, query)) = self;
51-
let func = Func::row(query);
52-
Args((name, func)).arg()
50+
let Args((name, func)) = self;
51+
name.arg().with_arg(func)
5352
}
5453
}
5554

@@ -79,8 +78,7 @@ where
7978
R: Into<Command>,
8079
{
8180
fn arg(self) -> cmd::Arg<Options> {
82-
let Args((name, query, opts)) = self;
83-
let Func(func) = Func::row(query);
81+
let Args((name, func, opts)) = self;
8482
name.arg().with_arg(func).with_opts(opts)
8583
}
8684
}

0 commit comments

Comments
 (0)