File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ pub enum Error {
16
16
#[ fail( display = "{}. stderr:\n \n {}" , message, stderr) ]
17
17
Cli { message : String , stderr : String } ,
18
18
#[ fail( display = "{}" , message) ]
19
- Config { message : String } ,
19
+ CrateConfig { message : String } ,
20
20
}
21
21
22
22
impl Error {
@@ -27,8 +27,8 @@ impl Error {
27
27
} )
28
28
}
29
29
30
- pub fn config ( message : & str ) -> Result < ( ) , Self > {
31
- Err ( Error :: Config {
30
+ pub fn crate_config ( message : & str ) -> Result < ( ) , Self > {
31
+ Err ( Error :: CrateConfig {
32
32
message : message. to_string ( ) ,
33
33
} )
34
34
}
@@ -42,7 +42,9 @@ impl Error {
42
42
message : _,
43
43
stderr : _,
44
44
} => "There was an error while calling another CLI tool. Details:\n \n " ,
45
- Error :: Config { message : _ } => "There was a configuration error. Details:\n \n " ,
45
+ Error :: CrateConfig { message : _ } => {
46
+ "There was a crate configuration error. Details:\n \n "
47
+ }
46
48
} . to_string ( )
47
49
}
48
50
}
Original file line number Diff line number Diff line change @@ -153,7 +153,9 @@ fn has_cdylib(path: &str) -> Result<bool, Error> {
153
153
154
154
pub fn check_crate_type ( path : & str ) -> Result < ( ) , Error > {
155
155
if !has_cdylib ( path) ? {
156
- Error :: config ( "crate-type must include cdylib to compile to wasm32-unknown-unknown" )
156
+ Error :: crate_config (
157
+ "crate-type must include cdylib to compile to wasm32-unknown-unknown. Add the following to your Cargo.toml file:\n \n [lib]\n crate-type = [\" cdylib\" ]"
158
+ )
157
159
} else {
158
160
Ok ( ( ) )
159
161
}
You can’t perform that action at this time.
0 commit comments