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

@@ -9,7 +9,7 @@ readme = "README.md"
edition = "2018"
[lib]
name = "wasmtime_api"
name = "wasmtime"
crate-type = ["lib", "staticlib", "cdylib"]
[dependencies]

View File

@@ -65,7 +65,7 @@ endif
WASMTIME_BIN_DIR = ${WASMTIME_API_DIR}/../target/${WASMTIME_API_MODE}
WASMTIME_C_LIB_DIR = ${WASMTIME_BIN_DIR}
WASMTIME_C_LIBS = wasmtime_api
WASMTIME_C_LIBS = wasmtime
WASMTIME_CC_LIBS = $(error unsupported c++)
WASMTIME_C_BINS = ${WASMTIME_C_LIBS:%=${WASMTIME_C_LIB_DIR}/lib%.a}

View File

@@ -2,7 +2,7 @@
//! invoking its exported function.
use anyhow::{format_err, Result};
use wasmtime_api::*;
use wasmtime::*;
const WAT: &str = r#"
(module

View File

@@ -3,7 +3,7 @@
use anyhow::{ensure, format_err, Context as _, Result};
use std::cell::Ref;
use std::rc::Rc;
use wasmtime_api::*;
use wasmtime::*;
struct HelloCallback;

View File

@@ -2,7 +2,7 @@
use anyhow::{bail, ensure, Context as _, Error};
use std::cell::Ref;
use wasmtime_api::*;
use wasmtime::*;
fn get_export_memory(exports: &[Extern], i: usize) -> Result<HostRef<Memory>, Error> {
if exports.len() <= i {

View File

@@ -3,7 +3,7 @@
use anyhow::{ensure, format_err, Context as _, Result};
use std::cell::Ref;
use std::rc::Rc;
use wasmtime_api::*;
use wasmtime::*;
struct Callback;

View File

@@ -1,6 +1,6 @@
use std::cell::{Ref, RefCell};
use std::rc::Rc;
use wasmtime_api::*;
use wasmtime::*;
#[test]
fn test_import_calling_export() {