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

@@ -5,12 +5,11 @@ use crate::memory::Memory;
use pyo3::prelude::*;
use pyo3::types::PyDict;
use std::rc::Rc;
use wasmtime_api as api;
use wasmtime_interface_types::ModuleData;
#[pyclass]
pub struct Instance {
pub instance: api::HostRef<api::Instance>,
pub instance: wasmtime::HostRef<wasmtime::Instance>,
pub data: Rc<ModuleData>,
}
@@ -24,7 +23,7 @@ impl Instance {
let module = self.instance.borrow().module().clone();
for (i, e) in module.borrow().exports().iter().enumerate() {
match e.r#type() {
api::ExternType::ExternFunc(ft) => {
wasmtime::ExternType::ExternFunc(ft) => {
let mut args_types = Vec::new();
for ty in ft.params().iter() {
args_types.push(ty.clone());
@@ -40,7 +39,7 @@ impl Instance {
)?;
exports.set_item(e.name().to_string(), f)?;
}
api::ExternType::ExternMemory(_) => {
wasmtime::ExternType::ExternMemory(_) => {
let f = Py::new(
py,
Memory {