summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-07-19 21:06:48 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-07-20 03:46:26 -0400
commita7bf154cb8bb47196e4c83efa1a61d73842a09b5 (patch)
treefcd27615a6231d6ad9caaaadd14233645acbf14c /src
parentc67d98eb7fed91b8ae70929e8fe43cecbe39d23c (diff)
Wrap rust at 80 columns.
Diffstat (limited to 'src')
-rw-r--r--src/binding.rs6
-rw-r--r--src/handlers.rs6
-rw-r--r--src/main.rs16
3 files changed, 21 insertions, 7 deletions
diff --git a/src/binding.rs b/src/binding.rs
index 62d727627..fc57200c3 100644
--- a/src/binding.rs
+++ b/src/binding.rs
@@ -37,7 +37,11 @@ extern "C" {
js_source: *const c_char,
) -> c_int;
pub fn deno_handle_msg_from_js(d: *const DenoC, buf: deno_buf);
- pub fn deno_reply_error(d: *const DenoC, cmd_id: uint32_t, msg: *const c_char);
+ pub fn deno_reply_error(
+ d: *const DenoC,
+ cmd_id: uint32_t,
+ msg: *const c_char,
+ );
pub fn deno_reply_null(d: *const DenoC, cmd_id: uint32_t);
pub fn deno_reply_code_fetch(
d: *const DenoC,
diff --git a/src/handlers.rs b/src/handlers.rs
index 0649e5a9b..e8cf62a5b 100644
--- a/src/handlers.rs
+++ b/src/handlers.rs
@@ -164,7 +164,8 @@ fn test_resolve_module() {
for &test in test_cases.iter() {
let module_specifier = String::from(test.0);
let containing_file = String::from(test.1);
- let (module_name, filename) = resolve_module(&module_specifier, &containing_file).unwrap();
+ let (module_name, filename) =
+ resolve_module(&module_specifier, &containing_file).unwrap();
assert_eq!(module_name, test.2);
assert_eq!(filename, test.3);
}
@@ -184,7 +185,8 @@ pub extern "C" fn handle_code_fetch(
let result = resolve_module(&module_specifier, &containing_file);
if result.is_err() {
let err = result.unwrap_err();
- let errmsg = format!("{} {} {}", err, module_specifier, containing_file);
+ let errmsg =
+ format!("{} {} {}", err, module_specifier, containing_file);
let errmsg_c = as_cstring(&errmsg);
unsafe { deno_reply_error(d, cmd_id, errmsg_c.as_ptr()) };
return;
diff --git a/src/main.rs b/src/main.rs
index e1284d303..efe7d86c0 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,8 +8,10 @@ use std::ffi::CString;
use std::ptr;
mod binding;
-use binding::{deno_delete, deno_execute, deno_handle_msg_from_js, deno_init, deno_last_exception,
- deno_new, deno_set_flags, DenoC};
+use binding::{
+ deno_delete, deno_execute, deno_handle_msg_from_js, deno_init,
+ deno_last_exception, deno_new, deno_set_flags, DenoC,
+};
// Pass the command line arguments to v8.
// Returns a vector of command line arguments that v8 did not understand.
@@ -58,10 +60,16 @@ impl Deno {
Deno { ptr: ptr }
}
- fn execute(&mut self, js_filename: &str, js_source: &str) -> Result<(), DenoException> {
+ fn execute(
+ &mut self,
+ js_filename: &str,
+ js_source: &str,
+ ) -> Result<(), DenoException> {
let filename = CString::new(js_filename).unwrap();
let source = CString::new(js_source).unwrap();
- let r = unsafe { deno_execute(self.ptr, filename.as_ptr(), source.as_ptr()) };
+ let r = unsafe {
+ deno_execute(self.ptr, filename.as_ptr(), source.as_ptr())
+ };
if r == 0 {
let ptr = unsafe { deno_last_exception(self.ptr) };
let cstr = unsafe { CStr::from_ptr(ptr) };