Skip to content

Commit

Permalink
Remove to_string()
Browse files Browse the repository at this point in the history
  • Loading branch information
rruckley committed Feb 2, 2024
1 parent bb3a658 commit 3f7c2d3
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/create_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use tmflib::tmf673::geographic_address::GeographicAddress;

fn main() {
let address = GeographicAddress::new(String::from("Site 1"))
let address = GeographicAddress::new("Site 1")
.number("5")
.street("Roseland")
.street_type("Avenue")
Expand Down
4 changes: 2 additions & 2 deletions examples/create_catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ use tmflib::tmf629::customer::Customer;


fn main() {
let org = Organization::new("A Customer".to_string());
let org = Organization::new("A Customer");
let cust = Customer::new(org);
let mut catalog = Catalog::new("Customer A Catalog");
let rel_party = RelatedParty::from(&cust);
let cat = Category::new("Customer Category".to_string());
let cat = Category::new("Customer Category");
catalog.add_party(rel_party);
catalog.add_category(CategoryRef::from(&cat));

Expand Down
2 changes: 1 addition & 1 deletion examples/create_customer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use tmflib::tmf629::customer::Customer;
use tmflib::tmf632::organization::Organization;

fn main() {
let org = Organization::new(String::from("ACustomer"));
let org = Organization::new("ACustomer");
let customer = Customer::new(org);

dbg!(&customer);
Expand Down
2 changes: 1 addition & 1 deletion examples/create_offer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn main() {
.description(String::from("This is a mandatory characteristic."));


let spec = ProductSpecification::new(String::from("MySpecification"))
let spec = ProductSpecification::new("MySpecification")
.with_charateristic(char1)
.with_charateristic(char2);

Expand Down
4 changes: 2 additions & 2 deletions examples/create_organization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ fn main() {
// Two methods to create an org object

// 1) use native constructor new()
let org1 = Organization::new(String::from("My Organization"));
let org1 = Organization::new("My Organization");
// 2) Use conversion from a String.
let org2 : Organization = String::from("My Organisation").into();
let org2 : Organization = String::from("Organisation from String").into();

dbg!(org1);
dbg!(org2);
Expand Down
4 changes: 2 additions & 2 deletions examples/create_site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ use tmflib::tmf674::geographic_site_v5::{GeographicSite, PlaceRefOrValue,Calenda


fn main() {
let address = GeographicAddress::new(String::from("HQ"))
let address = GeographicAddress::new("HQ")
.number("17")
.street("Lumeah")
.street_type("Ave")
.suburb("Elanora Heights")
.state("NSW");

let site = GeographicSite::new(String::from("Home"))
let site = GeographicSite::new("Home")
.place(PlaceRefOrValue::from(address))
.calendar(CalendarPeriod::business_hours());

Expand Down
4 changes: 2 additions & 2 deletions examples/link_offers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use tmflib::tmf620::product_offering::ProductOffering;
use tmflib::tmf620::product_offering_v5::ProductOffering;

fn main() {
let offer = ProductOffering::new(String::from("OriginalProduct"));
let offer = ProductOffering::new("OriginalProduct");

let mut new_offer = ProductOffering::new(String::from("NewProduct"));
let mut new_offer = ProductOffering::new("NewProduct");

new_offer.link_po(offer, "ParentChild", "Child");

Expand Down

0 comments on commit 3f7c2d3

Please sign in to comment.