Skip to content

Commit

Permalink
Rename this repository to "oaclt"
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Apr 15, 2024
1 parent bb0bf41 commit 70751c5
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[workspace]
members = ["crates/oleclient", "crates/oleclient_macros"]
members = ["crates/oaclt", "crates/oaclt_macros"]
resolver = "2"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# OleClient
# oaclt

OLE Automation client.
An **O**LE **A**utomation **cl**ien**t** for Rust.
4 changes: 2 additions & 2 deletions crates/oleclient/Cargo.toml → crates/oaclt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "oleclient"
name = "oaclt"
version = "0.0.0"
edition = "2021"
license = "MIT OR Apache-2.0"
Expand All @@ -9,7 +9,7 @@ rust-version = "1.73.0"
[dependencies]
derive_more = "0.99.17"
duplicate = "1.0.0"
oleclient_macros = { path = "../oleclient_macros" }
oaclt_macros = { path = "../oaclt_macros" }
thiserror = "1.0.49"

[dependencies.windows]
Expand Down
2 changes: 1 addition & 1 deletion crates/oleclient/src/lib.rs → crates/oaclt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use windows::{
},
};

pub use oleclient_macros::{new, TryFrom_Out};
pub use oaclt_macros::{new, TryFrom_Out};

pub fn init_apartment(dwcoinit: Coinit) -> windows::core::Result<CoUninitializeOnDrop> {
unsafe {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "oleclient_macros"
name = "oaclt_macros"
version = "0.0.0"
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use syn::{
parse_macro_input, DeriveInput, LitStr, Meta, MetaList, Token,
};

#[proc_macro_derive(new, attributes(oleclient))]
#[proc_macro_derive(new, attributes(oaclt))]
pub fn derive_new(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
let input = parse_macro_input!(input as DeriveInput);
return derive_new(input)
Expand All @@ -20,22 +20,22 @@ pub fn derive_new(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
let AttrVal(prog_id) = attrs
.iter()
.flat_map(|attr| match &attr.meta {
Meta::List(MetaList { path, .. }) if path.is_ident("oleclient") => {
Meta::List(MetaList { path, .. }) if path.is_ident("oaclt") => {
Some(attr.parse_args::<AttrVal>())
}
_ => None,
})
.exactly_one()
.map_err(|_| {
syn::Error::new(proc_macro2::Span::call_site(), "missing `#[oleclient(…)]`")
syn::Error::new(proc_macro2::Span::call_site(), "missing `#[oaclt(…)]`")
})??;

let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl();

Ok(quote! {
impl #impl_generics #ident #ty_generics #where_clause {
#vis fn new() -> ::oleclient::Result<Self> {
let disp = ::oleclient::idispatch_from_prog_id(::windows::core::w!(#prog_id))?;
#vis fn new() -> ::oaclt::Result<Self> {
let disp = ::oaclt::idispatch_from_prog_id(::windows::core::w!(#prog_id))?;
Ok(::std::convert::From::from(disp))
}
}
Expand Down Expand Up @@ -73,12 +73,12 @@ pub fn derive_try_from_out(input: proc_macro::TokenStream) -> proc_macro::TokenS
let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl();

Ok(quote! {
impl #impl_generics ::std::convert::TryFrom<::oleclient::Out> for #ident #ty_generics
impl #impl_generics ::std::convert::TryFrom<::oaclt::Out> for #ident #ty_generics
#where_clause
{
type Error = ::oleclient::Error;
type Error = ::oaclt::Error;

fn try_from(out: ::oleclient::Out) -> ::oleclient::Result<Self> {
fn try_from(out: ::oaclt::Out) -> ::oaclt::Result<Self> {
let disp = out.into_idispatch()?;
Ok(Self::from(disp))
}
Expand Down

0 comments on commit 70751c5

Please sign in to comment.