Skip to content

Commit 2073c58

Browse files
Cleanup and format
1 parent b5f963c commit 2073c58

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl ReplContext for ConsoleContext {
6565
fn current_repl(&self) -> &Repl<Self> {
6666
self.repl_stack.last().unwrap()
6767
}
68-
68+
6969
fn has_changes(&self) -> bool {
7070
self.transaction.as_ref().is_some_and(|(_, has_writes)| *has_writes)
7171
}

src/operations.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
use std::{error::Error, fs::read_to_string, path::Path, process::exit, rc::Rc};
88

99
use futures::stream::StreamExt;
10-
use typedb_driver::{answer::{QueryAnswer, QueryType}, Transaction, TransactionType};
10+
use typedb_driver::{
11+
answer::{QueryAnswer, QueryType},
12+
TransactionType,
13+
};
1114

1215
use crate::{
1316
printer::{print_document, print_row},
@@ -291,7 +294,8 @@ fn query_type_str(query_type: QueryType) -> &'static str {
291294
}
292295

293296
fn execute_query(context: &mut ConsoleContext, query: String, logging: bool) -> Result<(), typedb_driver::Error> {
294-
let (transaction, has_writes) = context.transaction.take().expect("Transaction query run without active transaction.");
297+
let (transaction, has_writes) =
298+
context.transaction.take().expect("Transaction query run without active transaction.");
295299
let (transaction, result, write_succes) = context.background_runtime.run(async move {
296300
let result = transaction.query(query).await;
297301
if logging {
@@ -374,7 +378,7 @@ fn execute_query(context: &mut ConsoleContext, query: String, logging: bool) ->
374378
Ok(answer) => {
375379
let write_query = !matches!(answer.get_query_type(), QueryType::ReadQuery);
376380
(transaction, Ok(()), write_query)
377-
},
381+
}
378382
Err(err) => (transaction, Err(err), false),
379383
}
380384
}

0 commit comments

Comments
 (0)