-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12da86b
commit 36c46a3
Showing
7 changed files
with
120 additions
and
118 deletions.
There are no files selected for viewing
168 changes: 84 additions & 84 deletions
168
providers/pulumi_wasm_provider_cloudflare_rust/src/types.rs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,4 @@ | ||
use crate::model::{Ref, Type}; | ||
|
||
pub(crate) mod cargo; | ||
pub(crate) mod source_code_librs; | ||
pub(crate) mod source_code_resource; | ||
pub(crate) mod source_code_types; | ||
|
||
fn convert_type(type_or_ref: &Type) -> String { | ||
match type_or_ref { | ||
Type::Boolean => "bool".into(), | ||
Type::Integer => "i32".into(), | ||
Type::Number => "f64".into(), | ||
Type::String => "String".into(), | ||
Type::Array(type_) => format!("Vec<{}>", convert_type(type_)), // "Vec<{}> | ||
Type::Object(type_) => { | ||
format!("std::collections::HashMap<String, {}>", convert_type(type_)) | ||
} | ||
Type::Ref(r) => match r { | ||
Ref::Type(tpe) => format!("crate::types::{}", tpe.name), | ||
Ref::Archive => "String".to_string(), //FIXME | ||
Ref::Asset => "String".to_string(), //FIXME | ||
Ref::Any => "String".to_string(), //FIXME | ||
}, | ||
Type::Option(type_) => format!("Option<{}>", convert_type(type_)), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters