Rename the wasmtime_api library to match the containing wasmtime crate (#594)

* Rename the `wasmtime_api` library to match the containing `wasmtime` crate

Commit d9ca508f80 renamed the
`wasmtime-api` crate to `wasmtime`, but left the name of the library it
contains as `wasmtime_api`.

It's fairly unusual for a crate to contain a library with a different
name, and it results in rather confusing error messages for a user; if
you list `wasmtime = "0.7"` in `Cargo.toml`, you can't `use
wasmtime::*`, you have to `use wasmtime_api::*;`.

Rename the `wasmtime_api` library to `wasmtime`.

* Stop renaming wasmtime to api on imports

Various users renamed the crate formerly known as wasmtime_api to api,
and then used api:: prefixes everywhere; change those all to wasmtime::
and drop the renaming.
This commit is contained in:
Josh Triplett
2019-11-19 14:47:39 -08:00
committed by Dan Gohman
parent 58dd4c6c88
commit 2635ccb742
21 changed files with 70 additions and 78 deletions

View File

@@ -34,7 +34,7 @@ fn generate_struct(item: &syn::ItemTrait) -> syn::Result<TokenStream> {
let root = root();
Ok(quote! {
#vis struct #name {
instance: #root::wasmtime_api::HostRef<#root::wasmtime_api::Instance>,
instance: #root::wasmtime::HostRef<#root::wasmtime::Instance>,
data: #root::wasmtime_interface_types::ModuleData,
}
})
@@ -48,7 +48,7 @@ fn generate_load(item: &syn::ItemTrait) -> syn::Result<TokenStream> {
#vis fn load_file(path: impl AsRef<std::path::Path>) -> #root::anyhow::Result<#name> {
let bytes = std::fs::read(path)?;
use #root::wasmtime_api::{HostRef, Config, Extern, Engine, Store, Instance, Module};
use #root::wasmtime::{HostRef, Config, Extern, Engine, Store, Instance, Module};
use #root::anyhow::{bail, format_err};
let mut config = Config::new();