瀏覽代碼

Get rid of extraneous panic

Getty Ritter 6 年之前
父節點
當前提交
b030e8ba96
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/tools/format.rs

+ 1 - 1
src/tools/format.rs

@@ -106,7 +106,7 @@ fn run() -> Result<(), FormatErr> {
             fs::File::open(path)?.read_to_end(&mut buf)?;
             String::from_utf8(buf)?
         },
-        None => panic!("No template specified!"),
+        None => Err(format!("No template specified!"))?,
     };
 
     let recfile = rrecutils::Recfile::parse(input)?;