32 lines
1.2 KiB
Diff
32 lines
1.2 KiB
Diff
From b018bb63d87f7c25acfbfc1964102fb1af64ce94 Mon Sep 17 00:00:00 2001
|
|
From: chenjiayi <chenjiayi22@huawei.com>
|
|
Date: Thu, 23 Nov 2023 20:14:43 +0800
|
|
Subject: [PATCH 083/103] test(devmaster): use unwrap instead of asserting is
|
|
ok
|
|
|
|
Use unwrap method to display more about error information.
|
|
---
|
|
exts/devmaster/src/lib/rules/rules_load.rs | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/exts/devmaster/src/lib/rules/rules_load.rs b/exts/devmaster/src/lib/rules/rules_load.rs
|
|
index b035f562..49da2d63 100644
|
|
--- a/exts/devmaster/src/lib/rules/rules_load.rs
|
|
+++ b/exts/devmaster/src/lib/rules/rules_load.rs
|
|
@@ -1737,10 +1737,10 @@ pub(crate) mod tests {
|
|
use std::{fs, path::Path};
|
|
|
|
pub(crate) fn create_tmp_file(dir: &'static str, file: &str, content: &str, truncate: bool) {
|
|
- assert!(fs::create_dir_all(dir).is_ok());
|
|
+ fs::create_dir_all(dir).unwrap();
|
|
let s = format!("{}/{}", dir, file);
|
|
let p = Path::new(&s);
|
|
- assert!(fs::write(p, content,).is_ok());
|
|
+ fs::write(p, content).unwrap();
|
|
let mut f = fs::OpenOptions::new()
|
|
.write(true)
|
|
.truncate(truncate)
|
|
--
|
|
2.33.0
|
|
|