mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
cargo fmt
This commit is contained in:
parent
153308dbf1
commit
99e41c73f3
1 changed files with 4 additions and 6 deletions
|
@ -21,8 +21,8 @@ use roc_types::subs::{Subs, VarStore, Variable};
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io;
|
use std::io;
|
||||||
use std::str::from_utf8_unchecked;
|
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
use std::str::from_utf8_unchecked;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
use tokio::task::spawn_blocking;
|
use tokio::task::spawn_blocking;
|
||||||
|
@ -531,7 +531,7 @@ fn parse_src(
|
||||||
filename: PathBuf,
|
filename: PathBuf,
|
||||||
msg_tx: MsgSender,
|
msg_tx: MsgSender,
|
||||||
module_ids: SharedModules<'_, '_>,
|
module_ids: SharedModules<'_, '_>,
|
||||||
src_bytes: &[u8]
|
src_bytes: &[u8],
|
||||||
) -> Result<ModuleId, LoadingProblem> {
|
) -> Result<ModuleId, LoadingProblem> {
|
||||||
let state = State::new(src_bytes, Attempting::Module);
|
let state = State::new(src_bytes, Attempting::Module);
|
||||||
let arena = Bump::new();
|
let arena = Bump::new();
|
||||||
|
@ -590,9 +590,7 @@ fn load_filename(
|
||||||
module_ids: SharedModules<'_, '_>,
|
module_ids: SharedModules<'_, '_>,
|
||||||
) -> Result<ModuleId, LoadingProblem> {
|
) -> Result<ModuleId, LoadingProblem> {
|
||||||
match fs::read(&filename) {
|
match fs::read(&filename) {
|
||||||
Ok(bytes) => {
|
Ok(bytes) => parse_src(filename, msg_tx, module_ids, bytes.as_ref()),
|
||||||
parse_src(filename, msg_tx, module_ids, bytes.as_ref())
|
|
||||||
}
|
|
||||||
Err(err) => Err(LoadingProblem::FileProblem {
|
Err(err) => Err(LoadingProblem::FileProblem {
|
||||||
filename,
|
filename,
|
||||||
error: err.kind(),
|
error: err.kind(),
|
||||||
|
@ -1019,7 +1017,7 @@ fn parse_and_constrain(
|
||||||
let imported_modules = header.imported_modules;
|
let imported_modules = header.imported_modules;
|
||||||
|
|
||||||
// SAFETY: By this point we've already incrementally verified that there
|
// SAFETY: By this point we've already incrementally verified that there
|
||||||
// are no UTF-8 errors in these bytes. If there had been any UTF-8 errors,
|
// are no UTF-8 errors in these bytes. If there had been any UTF-8 errors,
|
||||||
// we'd have bailed out before now.
|
// we'd have bailed out before now.
|
||||||
let src: Box<str> = unsafe { from_utf8_unchecked(header.src.as_ref()).to_string().into() };
|
let src: Box<str> = unsafe { from_utf8_unchecked(header.src.as_ref()).to_string().into() };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue