Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

Panic in prefetch::crate_type #8

Open
jbboehr opened this issue Jun 5, 2018 · 1 comment
Open

Panic in prefetch::crate_type #8

jbboehr opened this issue Jun 5, 2018 · 1 comment

Comments

@jbboehr
Copy link

jbboehr commented Jun 5, 2018

There seems to be some kind of quoting issue around crate-type. It works for me when I do the following:

diff --git a/src/prefetch.rs b/src/prefetch.rs
index 0078cb4..70bb1d3 100644
--- a/src/prefetch.rs
+++ b/src/prefetch.rs
@@ -246,7 +246,7 @@ fn crate_type(v: &BTreeMap<String, toml::Value>) -> Option<String> {
     if let Some(crate_file) = v.get("lib") {
         if let Some(crate_file) = crate_file.as_table() {
             if let Some(crate_type) = crate_file.get("crate-type") {
-                return Some(crate_type.as_str().unwrap().to_string())
+                return Some(format!("\"{}\"", crate_type[0].as_str().unwrap().to_string()));
             }
         }
     }

This and #7 I've encountered while trying to package imageflow.

@jbboehr
Copy link
Author

jbboehr commented Jun 5, 2018

This is definitely not the right way to fix it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant