File tree 1 file changed +2
-10
lines changed
1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change 1
1
use anyhow:: { anyhow, Result } ;
2
- use std:: {
3
- borrow:: Cow ,
4
- fs,
5
- io:: { self } ,
6
- path:: Path ,
7
- str,
8
- } ;
2
+ use std:: { borrow:: Cow , fs, path:: Path , str} ;
9
3
10
4
use super :: bytecode;
11
5
@@ -60,7 +54,7 @@ impl Plugin {
60
54
}
61
55
62
56
/// Constructs a new instance of Plugin from a given path.
63
- pub fn new_from_path < P : AsRef < Path > > ( path : P ) -> io :: Result < Self > {
57
+ pub fn new_from_path < P : AsRef < Path > > ( path : P ) -> Result < Self > {
64
58
let bytes = fs:: read ( path) ?;
65
59
Ok ( Self :: new ( bytes. into ( ) ) )
66
60
}
@@ -69,9 +63,7 @@ impl Plugin {
69
63
pub fn as_bytes ( & self ) -> & [ u8 ] {
70
64
& self . bytes
71
65
}
72
- }
73
66
74
- impl Plugin {
75
67
/// Generate valid QuickJS bytecode from Javascript using a Plugin.
76
68
pub ( crate ) fn compile_source ( & self , js_source_code : & [ u8 ] ) -> Result < Vec < u8 > > {
77
69
bytecode:: compile_source ( self . as_bytes ( ) , js_source_code)
You can’t perform that action at this time.
0 commit comments