From 6c2811d062edaf2a58ba97bc303829f6f6ea1ad1 Mon Sep 17 00:00:00 2001 From: rasul Date: Fri, 3 Apr 2020 18:47:46 -0500 Subject: [PATCH] Get rid of the leaky box. It was leftover from an earlier time when there was generic code to load a toml file and put it into a struct. It is no longer necessary. --- src/config/config.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/config/config.rs b/src/config/config.rs index 1cf13a1..5640f70 100644 --- a/src/config/config.rs +++ b/src/config/config.rs @@ -47,10 +47,8 @@ impl Config { path.display(), ); - // this Box::leak() may not be great? something about leaking memory? - // i don't know what i'm doing here? Ok(try_print!( - toml::from_str(Box::leak(file_contents.into_boxed_str())), + toml::from_str(&file_contents), "Unable to parse toml: {}", path.display(), ))