Skip to content

Commit 635171d

Browse files
committed
cleanup even more
1 parent cf2cf6c commit 635171d

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

crates/wasm-pkg-client/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ pub type ContentStream = Pin<Box<dyn Stream<Item = Result<Bytes, Error>> + Send
6767
/// An alias for a PublishingSource (generally a file)
6868
pub type PublishingSource = Pin<Box<dyn ReaderSeeker + Send + Sync + 'static>>;
6969

70-
// Convenience method to convert a byte array into a [`PublishingSource`]
71-
pub fn source_from_slice<'a>(data: &'a [u8]) -> Pin<Box<dyn ReaderSeeker + Send + Sync + 'a>> {
72-
Box::pin(std::io::Cursor::new(data))
73-
}
74-
7570
/// A supertrait combining tokio's AsyncRead and AsyncSeek.
7671
pub trait ReaderSeeker: tokio::io::AsyncRead + tokio::io::AsyncSeek {}
7772

crates/wasm-pkg-client/src/local.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ pub struct LocalConfig {
3535
}
3636

3737
impl LocalConfig {
38+
// creates a [`Self`] using a generated temporary directory. Upon dropping the [`TempDir`] handle,
39+
// the temporary directory will be deleted.
3840
pub fn temp_dir() -> Result<(Self, TempDir), Error> {
3941
let handle = TempDir::new()?;
4042
let root = handle.path().to_owned();

crates/wasm-pkg-common/src/package.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ pub struct PackageSpec {
8686
}
8787

8888
impl PackageSpec {
89+
// Returns a copy of the associated package reference.
8990
pub fn package(&self) -> PackageRef {
9091
self.package.clone()
9192
}
9293

94+
// Returns a copy of the attached semver [`Version`] object if it exists.
9395
pub fn version(&self) -> Option<Version> {
9496
self.version.clone()
9597
}

crates/wkg/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use tracing::level_filters::LevelFilter;
1111
use wasm_pkg_client::{
1212
caching::{CachingClient, FileCache},
1313
local::LocalConfig,
14-
Client, PackageLoader, PublishOpts,
14+
Client, PublishOpts,
1515
};
1616
use wasm_pkg_common::{
1717
self,

0 commit comments

Comments
 (0)