mirror of
https://github.com/Noratrieb/terustform.git
synced 2026-01-14 16:35:11 +01:00
stuff
This commit is contained in:
parent
f3c37539f0
commit
e0f753c0c2
2 changed files with 21 additions and 8 deletions
|
|
@ -4,7 +4,7 @@ use terustform::{
|
|||
framework::{
|
||||
datasource::{self, DataSource},
|
||||
provider::Provider,
|
||||
AttrPath, DResult, Diagnostics, StringValue, ValueModel,
|
||||
AttrPath, DResult, StringValue, ValueModel,
|
||||
},
|
||||
values::Value,
|
||||
};
|
||||
|
|
@ -75,11 +75,8 @@ impl DataSource for ExampleDataSource {
|
|||
fn read(&self, config: Value) -> DResult<Value> {
|
||||
let mut model = ExampleDataSourceModel::from_value(config, &AttrPath::root())?;
|
||||
|
||||
let StringValue::Known(name_str) = &model.name else {
|
||||
return Err(Diagnostics::error_string(
|
||||
"model name must be known".to_owned(),
|
||||
));
|
||||
};
|
||||
let name_str = model.name.expect_known(AttrPath::attr("name"))?;
|
||||
|
||||
let meow = format!("mrrrrr i am {name_str}");
|
||||
|
||||
model.meow = StringValue::Known(meow);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue