feat: use dyn
This commit is contained in:
@@ -17,8 +17,8 @@ impl CommandImpl {
|
||||
information!("Verbose count: {}", verbose_count);
|
||||
information!(r#"Print using command line:
|
||||
commit-msg usage"#);
|
||||
let a = CommitMsgCheckRegex::new_default();
|
||||
let b = CommitMsgCheckQuickJs::new_from_js(r##"
|
||||
let a = Box::new(CommitMsgCheckRegex::new_default()) as Box<dyn CommitMsgCheck>;
|
||||
let b = Box::new(CommitMsgCheckQuickJs::new_from_js(r##"
|
||||
function check(a) {
|
||||
return false;
|
||||
}
|
||||
@@ -26,7 +26,7 @@ commit-msg usage"#);
|
||||
function hint() {
|
||||
return "hello";
|
||||
}
|
||||
"##).expect("err");
|
||||
"##).expect("err")) as Box<dyn CommitMsgCheck>;
|
||||
|
||||
if !a.check("a") {
|
||||
a.print_hint();
|
||||
|
||||
Reference in New Issue
Block a user