11use std:: collections:: HashSet ;
2- use std:: error:: Error ;
32use std:: fmt:: Write ;
43
54use proc_macro2:: TokenStream ;
@@ -20,7 +19,7 @@ pub(crate) struct StructPaths {
2019}
2120
2221impl StructPaths {
23- pub ( crate ) fn new ( class : Id ) -> Result < Self , Box < dyn Error > > {
22+ pub ( crate ) fn new ( class : Id ) -> Result < Self , anyhow :: Error > {
2423 Ok ( Self {
2524 mod_ : Class :: mod_for ( class) ?,
2625 struct_name : Class :: name_for ( class) ?,
@@ -34,7 +33,7 @@ pub(crate) struct Class {
3433 pub java : JavaClass ,
3534}
3635
37- fn rust_id ( id : & str ) -> Result < String , Box < dyn Error > > {
36+ fn rust_id ( id : & str ) -> Result < String , anyhow :: Error > {
3837 Ok ( match RustIdentifier :: from_str ( id) {
3938 RustIdentifier :: Identifier ( id) => id,
4039 RustIdentifier :: KeywordRawSafe ( id) => id,
@@ -47,7 +46,7 @@ fn rust_id(id: &str) -> Result<String, Box<dyn Error>> {
4746}
4847
4948impl Class {
50- pub ( crate ) fn mod_for ( class : Id ) -> Result < String , Box < dyn Error > > {
49+ pub ( crate ) fn mod_for ( class : Id ) -> Result < String , anyhow :: Error > {
5150 let mut buf = String :: new ( ) ;
5251 for component in class {
5352 match component {
@@ -64,7 +63,7 @@ impl Class {
6463 Ok ( buf)
6564 }
6665
67- pub ( crate ) fn name_for ( class : Id ) -> Result < String , Box < dyn Error > > {
66+ pub ( crate ) fn name_for ( class : Id ) -> Result < String , anyhow :: Error > {
6867 let mut buf = String :: new ( ) ;
6968 for component in class. iter ( ) {
7069 match component {
@@ -76,7 +75,7 @@ impl Class {
7675 Ok ( buf)
7776 }
7877
79- pub ( crate ) fn new ( java : JavaClass ) -> Result < Self , Box < dyn Error > > {
78+ pub ( crate ) fn new ( java : JavaClass ) -> Result < Self , anyhow :: Error > {
8079 let rust = StructPaths :: new ( java. path ( ) ) ?;
8180
8281 Ok ( Self { rust, java } )
0 commit comments