Skip to content

Commit 2810c02

Browse files
committed
Clean: clippy.
1 parent 19ce1f5 commit 2810c02

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

server/src/processing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pub enum CodeMirrorDocBlockTransaction {
126126
#[derive(Clone, Debug, PartialEq, TS)]
127127
// Serde replaces this struct with a tuple for coding efficiency -- see
128128
// `CodeMirrorDocBlockTuple`.
129-
#[ts(as="CodeMirrorDocBlockTuple")]
129+
#[ts(as = "CodeMirrorDocBlockTuple")]
130130
pub struct CodeMirrorDocBlock {
131131
// From -- the starting character this doc block is anchored to.
132132
pub from: usize,

server/src/webserver.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ lazy_static! {
436436
#[cfg(debug_assertions)]
437437
hl.push("server");
438438
hl.push("hashLocations.json");
439-
let json = fs::read_to_string(hl.clone()).expect(&format!("Unable to read {}", hl.to_string_lossy()));
439+
let json = fs::read_to_string(hl.clone()).unwrap_or_else(|_| panic!("Unable to read {}", hl.to_string_lossy()));
440440
let hmm: HashMap<String, String> = serde_json::from_str(&json).unwrap();
441441
hmm
442442
};
@@ -1371,7 +1371,12 @@ pub fn configure_logger(level: LevelFilter) -> Result<(), Box<dyn std::error::Er
13711371
#[cfg(debug_assertions)]
13721372
l4rs.push("server");
13731373
let config_file = l4rs.join("log4rs.yml");
1374-
let mut config = load_config_file(&config_file, Default::default()).expect(&format!("Unable to load config file {}", config_file.to_string_lossy()));
1374+
let mut config = load_config_file(&config_file, Default::default()).unwrap_or_else(|_| {
1375+
panic!(
1376+
"Unable to load config file {}",
1377+
config_file.to_string_lossy()
1378+
)
1379+
});
13751380
config.root_mut().set_level(level);
13761381
log4rs::init_config(config)?;
13771382
Ok(())

0 commit comments

Comments
 (0)