Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Joinhack committed Jan 17, 2025
1 parent e568879 commit df91154
Show file tree
Hide file tree
Showing 14 changed files with 290 additions and 346 deletions.
6 changes: 3 additions & 3 deletions blockless/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ impl BlocklessContext {
}

pub(crate) fn set_permisions(&mut self, config: &PermissionsConfig) {
self.preview1_ctx.as_mut().map(|ctx|
ctx.set_permissions_config(config).unwrap()
);
self.preview1_ctx
.as_mut()
.map(|ctx| ctx.set_permissions_config(config).unwrap());
}
}

Expand Down
18 changes: 8 additions & 10 deletions bls-runtime/src/cli_clap.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#![allow(unused)]
use anyhow::{bail, Result};
use blockless::{
BlocklessConfig, BlocklessModule, BlsNnGraph, BlsOptions, ModuleType, OptimizeOpts,
OptionParser, Permission, PermissionAllow, PermissionsConfig, Stderr, Stdin, Stdout
BlocklessConfig, BlocklessModule, BlsNnGraph, BlsOptions, ModuleType, OptimizeOpts,
OptionParser, Permission, PermissionAllow, PermissionsConfig, Stderr, Stdin, Stdout,
};
use clap::{
builder::{TypedValueParser, ValueParser},
Arg, ArgMatches, Command, Parser,
};
use std::{
collections::HashMap,
net::{
IpAddr, SocketAddr, TcpListener, ToSocketAddrs
},
option, path::{Path, PathBuf}, str::FromStr
collections::HashMap,
net::{IpAddr, SocketAddr, TcpListener, ToSocketAddrs},
option,
path::{Path, PathBuf},
str::FromStr,
};
use url::Url;

Expand Down Expand Up @@ -231,7 +231,7 @@ pub struct PermissionFlags {
#[clap(long = "allow-write", id="allow-write", num_args=(0..) , value_name = "[PATH[,]]", help = ALLOW_WRITE_HELP, value_parser = parser_allow)]
pub allow_write: Option<PermissionAllow>,

#[clap(long = "allow-all", id="allow-all", help = "Allow all permissions.")]
#[clap(long = "allow-all", id = "allow-all", help = "Allow all permissions.")]
pub allow_all: bool,
}

Expand Down Expand Up @@ -385,11 +385,9 @@ pub(crate) struct CliCommandOpts {

#[clap(long = "nn-graph", value_name = "NN_GRAPH", value_parser = parse_nn_graph, help = NN_GRAPH_HELP)]
pub nn_graph: Vec<BlsNnGraph>,

}

impl CliCommandOpts {

#[inline(always)]
pub fn fs_root_path(&self) -> Option<&String> {
self.fs_root_path.as_ref()
Expand Down
6 changes: 3 additions & 3 deletions bls-runtime/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ mod plog;
mod v86;
mod v86config;
use blockless::{blockless_run, LoggerLevel, Stdin};
use clap::{CommandFactory, FromArgMatches};
#[allow(unused_imports)]
use clap::Parser;
use clap::{CommandFactory, FromArgMatches};
use cli_clap::{CliCommandOpts, RuntimeType};
use config::load_cli_config_extract_from_car;
#[allow(unused_imports)]
Expand Down Expand Up @@ -228,10 +228,10 @@ fn parse_args() -> CliCommandOpts {
o.permission_flags.allow_write = Some(blockless::PermissionAllow::AllowAll);
}
o
},
}
Err(_) => {
exit(255);
},
}
}
}

Expand Down
Loading

0 comments on commit df91154

Please sign in to comment.