Skip to content

Commit 4ea3da4

Browse files
committed
cargo fmt
1 parent cc8de88 commit 4ea3da4

File tree

9 files changed

+25
-24
lines changed

9 files changed

+25
-24
lines changed

src/gen/callback_interface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::gen::render::{Renderable, TypeHelperRenderer};
2-
use genco::prelude::*;
32
use crate::gen::CodeType;
3+
use genco::prelude::*;
44

55
#[derive(Debug)]
66
pub struct CallbackInterfaceCodeType {

src/gen/code_type.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
use std::fmt::Debug;
32
use uniffi_bindgen::backend::Literal;
43

src/gen/compounds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
use crate::gen::CodeType;
12
use genco::lang::dart;
23
use genco::prelude::*;
34
use paste::paste;
4-
use crate::gen::CodeType;
55
use uniffi_bindgen::interface::Type;
66

77
use super::oracle::{AsCodeType, DartCodeOracle};

src/gen/enums.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use genco::prelude::*;
2-
use uniffi_bindgen::backend::{Literal};
31
use crate::gen::CodeType;
2+
use genco::prelude::*;
3+
use uniffi_bindgen::backend::Literal;
44
use uniffi_bindgen::interface::{AsType, Enum};
55

66
use super::oracle::{AsCodeType, DartCodeOracle};

src/gen/mod.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use crate::gen::oracle::DartCodeOracle;
1515
use uniffi_bindgen::{BindingGenerator, ComponentInterface};
1616

1717
mod callback_interface;
18+
mod code_type;
1819
mod compounds;
1920
mod enums;
2021
mod functions;
@@ -25,7 +26,6 @@ mod records;
2526
mod render;
2627
pub mod stream;
2728
mod types;
28-
mod code_type;
2929

3030
pub use code_type::CodeType;
3131

@@ -208,10 +208,10 @@ impl BindingGenerator for DartBindingGenerator {
208208
settings: &uniffi_bindgen::GenerationSettings,
209209
components: &[uniffi_bindgen::Component<Self::Config>],
210210
) -> Result<()> {
211-
212211
for Component { ci, config, .. } in components {
213-
214-
let filename = settings.out_dir.join(format!("{}.dart", config.cdylib_name()));
212+
let filename = settings
213+
.out_dir
214+
.join(format!("{}.dart", config.cdylib_name()));
215215
let tokens = DartWrapper::new(ci, config).generate();
216216
let file = std::fs::File::create(filename)?;
217217

@@ -227,7 +227,7 @@ impl BindingGenerator for DartBindingGenerator {
227227
}
228228
Ok(())
229229
}
230-
230+
231231
fn new_config(&self, root_toml: &toml::value::Value) -> Result<Self::Config> {
232232
Ok(
233233
match root_toml.get("bindings").and_then(|b| b.get("dart")) {
@@ -236,13 +236,12 @@ impl BindingGenerator for DartBindingGenerator {
236236
},
237237
)
238238
}
239-
239+
240240
fn update_component_configs(
241241
&self,
242242
settings: &uniffi_bindgen::GenerationSettings,
243243
components: &mut Vec<uniffi_bindgen::Component<Self::Config>>,
244244
) -> Result<()> {
245-
246245
for c in &mut *components {
247246
c.config.cdylib_name.get_or_insert_with(|| {
248247
settings

src/gen/objects.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use genco::prelude::*;
2-
use uniffi_bindgen::backend::{Literal};
2+
use uniffi_bindgen::backend::Literal;
33
use uniffi_bindgen::interface::{AsType, Method, Object};
44

5-
use crate::gen::CodeType;
65
use crate::gen::oracle::{AsCodeType, DartCodeOracle};
76
use crate::gen::render::AsRenderable;
87
use crate::gen::render::{Renderable, TypeHelperRenderer};
8+
use crate::gen::CodeType;
99

1010
use super::stream::generate_stream;
1111

src/gen/oracle.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,14 @@ impl DartCodeOracle {
230230
let call = quote!($(Self::find_lib_instance()).$ffi_func);
231231
match callable.return_type() {
232232
Some(Type::External { .. }) => {
233-
// Some(return_type) if ci.is_external(&return_type) => {
234-
// let ffi_type = FfiType::from(return_type);
235-
// match ffi_type {
236-
// FfiType::RustBuffer(Some(ExternalFfiMetadata { .. })) => {
237-
todo!("Need to convert the RustBuffer from our package to the RustBuffer of the external package")
238-
}
239-
// _ => call,
240-
// }
233+
// Some(return_type) if ci.is_external(&return_type) => {
234+
// let ffi_type = FfiType::from(return_type);
235+
// match ffi_type {
236+
// FfiType::RustBuffer(Some(ExternalFfiMetadata { .. })) => {
237+
todo!("Need to convert the RustBuffer from our package to the RustBuffer of the external package")
238+
}
239+
// _ => call,
240+
// }
241241
// }
242242
_ => call,
243243
}

src/gen/primitives/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use crate::r#gen::CodeType;
21
use crate::gen::{
32
quote,
43
render::{Renderable, TypeHelperRenderer},
54
};
5+
use crate::r#gen::CodeType;
66

77
use genco::lang::dart;
88
// use uniffi_bindgen::backend::CodeType;

src/gen/types.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ impl Renderer<(FunctionDefinition, dart::Tokens)> for TypeHelpersRenderer<'_> {
8484

8585
// Let's include the string converter
8686
self.include_once_check(&Type::String.as_codetype().canonical_name(), &Type::String);
87-
self.include_once_check(&Type::Boolean.as_codetype().canonical_name(), &Type::Boolean);
87+
self.include_once_check(
88+
&Type::Boolean.as_codetype().canonical_name(),
89+
&Type::Boolean,
90+
);
8891
let helpers_definitions = quote! {
8992
$(for (_, ty) in self.get_include_names().iter() => $(ty.as_renderable().render_type_helper(self)) )
9093
};

0 commit comments

Comments
 (0)