Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use qualified paths for all macro generated signatures #390

Closed
chaoky opened this issue Jan 9, 2023 · 1 comment
Closed

use qualified paths for all macro generated signatures #390

chaoky opened this issue Jan 9, 2023 · 1 comment

Comments

@chaoky
Copy link

chaoky commented Jan 9, 2023

I stumbled upon this when defining my Api's result type,
not prefixing the module's name is a Rust convention ie. module::Result instead of module::ModuleResult.

is there a reason to not use qualified paths in the generated code?

type Result<T> = std::result::Result<T, Error>;

#[tarpc::service]
pub trait Api {
    async fn active_tables() -> Result<Vec<Instance>>;
    async fn all_tables(from: usize, to: usize) -> Result<Vec<Instance>>;
    async fn update_table(new_table: Instance) -> Result<()>;
}

#[derive(Error, Debug, Serialize, Deserialize)]
pub enum Error {
    ...
}
@tikue
Copy link
Collaborator

tikue commented Feb 4, 2024

Hi, sorry for not responding last year! There was no reason other than laziness! And as of #417, it should be fixed :)

@tikue tikue closed this as completed Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants