Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions cargo-typify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,6 @@ impl std::convert::TryFrom<&str> for IdOrName {
value.parse()
}
}
impl std::convert::TryFrom<&String> for IdOrName {
type Error = &'static str;
fn try_from(value: &String) -> Result<Self, &'static str> {
value.parse()
}
}
impl std::convert::TryFrom<String> for IdOrName {
type Error = &'static str;
fn try_from(value: String) -> Result<Self, &'static str> {
Expand Down Expand Up @@ -166,12 +160,6 @@ impl std::convert::TryFrom<&str> for Name {
value.parse()
}
}
impl std::convert::TryFrom<&String> for Name {
type Error = &'static str;
fn try_from(value: &String) -> Result<Self, &'static str> {
value.parse()
}
}
impl std::convert::TryFrom<String> for Name {
type Error = &'static str;
fn try_from(value: String) -> Result<Self, &'static str> {
Expand Down
20 changes: 0 additions & 20 deletions cargo-typify/tests/outputs/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ impl ::std::convert::From<Fruit>
value.0
}
}
impl ::std::convert::From<&Fruit> for Fruit {
fn from(value: &Fruit) -> Self {
value.clone()
}
}
impl ::std::convert::From<::std::collections::HashMap<::std::string::String, ::std::string::String>>
for Fruit
{
Expand Down Expand Up @@ -105,11 +100,6 @@ pub enum FruitOrVeg {
Veg(Veggie),
Fruit(Fruit),
}
impl ::std::convert::From<&Self> for FruitOrVeg {
fn from(value: &FruitOrVeg) -> Self {
value.clone()
}
}
impl ::std::convert::From<Veggie> for FruitOrVeg {
fn from(value: Veggie) -> Self {
Self::Veg(value)
Expand Down Expand Up @@ -153,11 +143,6 @@ pub struct Veggie {
#[serde(rename = "veggieName")]
pub veggie_name: ::std::string::String,
}
impl ::std::convert::From<&Veggie> for Veggie {
fn from(value: &Veggie) -> Self {
value.clone()
}
}
impl Veggie {
pub fn builder() -> builder::Veggie {
Default::default()
Expand Down Expand Up @@ -197,11 +182,6 @@ pub struct Veggies {
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub vegetables: ::std::vec::Vec<Veggie>,
}
impl ::std::convert::From<&Veggies> for Veggies {
fn from(value: &Veggies) -> Self {
value.clone()
}
}
impl ::std::default::Default for Veggies {
fn default() -> Self {
Self {
Expand Down
20 changes: 0 additions & 20 deletions cargo-typify/tests/outputs/custom_btree_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ impl ::std::convert::From<Fruit>
value.0
}
}
impl ::std::convert::From<&Fruit> for Fruit {
fn from(value: &Fruit) -> Self {
value.clone()
}
}
impl
::std::convert::From<::std::collections::BTreeMap<::std::string::String, ::std::string::String>>
for Fruit
Expand Down Expand Up @@ -106,11 +101,6 @@ pub enum FruitOrVeg {
Veg(Veggie),
Fruit(Fruit),
}
impl ::std::convert::From<&Self> for FruitOrVeg {
fn from(value: &FruitOrVeg) -> Self {
value.clone()
}
}
impl ::std::convert::From<Veggie> for FruitOrVeg {
fn from(value: Veggie) -> Self {
Self::Veg(value)
Expand Down Expand Up @@ -154,11 +144,6 @@ pub struct Veggie {
#[serde(rename = "veggieName")]
pub veggie_name: ::std::string::String,
}
impl ::std::convert::From<&Veggie> for Veggie {
fn from(value: &Veggie) -> Self {
value.clone()
}
}
impl Veggie {
pub fn builder() -> builder::Veggie {
Default::default()
Expand Down Expand Up @@ -198,11 +183,6 @@ pub struct Veggies {
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub vegetables: ::std::vec::Vec<Veggie>,
}
impl ::std::convert::From<&Veggies> for Veggies {
fn from(value: &Veggies) -> Self {
value.clone()
}
}
impl ::std::default::Default for Veggies {
fn default() -> Self {
Self {
Expand Down
20 changes: 0 additions & 20 deletions cargo-typify/tests/outputs/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ impl ::std::convert::From<Fruit>
value.0
}
}
impl ::std::convert::From<&Fruit> for Fruit {
fn from(value: &Fruit) -> Self {
value.clone()
}
}
impl ::std::convert::From<::std::collections::HashMap<::std::string::String, ::std::string::String>>
for Fruit
{
Expand Down Expand Up @@ -105,11 +100,6 @@ pub enum FruitOrVeg {
Veg(Veggie),
Fruit(Fruit),
}
impl ::std::convert::From<&Self> for FruitOrVeg {
fn from(value: &FruitOrVeg) -> Self {
value.clone()
}
}
impl ::std::convert::From<Veggie> for FruitOrVeg {
fn from(value: Veggie) -> Self {
Self::Veg(value)
Expand Down Expand Up @@ -153,11 +143,6 @@ pub struct Veggie {
#[serde(rename = "veggieName")]
pub veggie_name: ::std::string::String,
}
impl ::std::convert::From<&Veggie> for Veggie {
fn from(value: &Veggie) -> Self {
value.clone()
}
}
#[doc = "A representation of a person, company, organization, or place"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
Expand Down Expand Up @@ -192,11 +177,6 @@ pub struct Veggies {
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub vegetables: ::std::vec::Vec<Veggie>,
}
impl ::std::convert::From<&Veggies> for Veggies {
fn from(value: &Veggies) -> Self {
value.clone()
}
}
impl ::std::default::Default for Veggies {
fn default() -> Self {
Self {
Expand Down
20 changes: 0 additions & 20 deletions cargo-typify/tests/outputs/multi_derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ impl ::std::convert::From<Fruit>
value.0
}
}
impl ::std::convert::From<&Fruit> for Fruit {
fn from(value: &Fruit) -> Self {
value.clone()
}
}
impl ::std::convert::From<::std::collections::HashMap<::std::string::String, ::std::string::String>>
for Fruit
{
Expand Down Expand Up @@ -109,11 +104,6 @@ pub enum FruitOrVeg {
Veg(Veggie),
Fruit(Fruit),
}
impl ::std::convert::From<&Self> for FruitOrVeg {
fn from(value: &FruitOrVeg) -> Self {
value.clone()
}
}
impl ::std::convert::From<Veggie> for FruitOrVeg {
fn from(value: Veggie) -> Self {
Self::Veg(value)
Expand Down Expand Up @@ -159,11 +149,6 @@ pub struct Veggie {
#[serde(rename = "veggieName")]
pub veggie_name: ::std::string::String,
}
impl ::std::convert::From<&Veggie> for Veggie {
fn from(value: &Veggie) -> Self {
value.clone()
}
}
#[doc = "A representation of a person, company, organization, or place"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
Expand Down Expand Up @@ -200,11 +185,6 @@ pub struct Veggies {
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub vegetables: ::std::vec::Vec<Veggie>,
}
impl ::std::convert::From<&Veggies> for Veggies {
fn from(value: &Veggies) -> Self {
value.clone()
}
}
impl ::std::default::Default for Veggies {
fn default() -> Self {
Self {
Expand Down
20 changes: 0 additions & 20 deletions cargo-typify/tests/outputs/no-builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ impl ::std::convert::From<Fruit>
value.0
}
}
impl ::std::convert::From<&Fruit> for Fruit {
fn from(value: &Fruit) -> Self {
value.clone()
}
}
impl ::std::convert::From<::std::collections::HashMap<::std::string::String, ::std::string::String>>
for Fruit
{
Expand Down Expand Up @@ -105,11 +100,6 @@ pub enum FruitOrVeg {
Veg(Veggie),
Fruit(Fruit),
}
impl ::std::convert::From<&Self> for FruitOrVeg {
fn from(value: &FruitOrVeg) -> Self {
value.clone()
}
}
impl ::std::convert::From<Veggie> for FruitOrVeg {
fn from(value: Veggie) -> Self {
Self::Veg(value)
Expand Down Expand Up @@ -153,11 +143,6 @@ pub struct Veggie {
#[serde(rename = "veggieName")]
pub veggie_name: ::std::string::String,
}
impl ::std::convert::From<&Veggie> for Veggie {
fn from(value: &Veggie) -> Self {
value.clone()
}
}
#[doc = "A representation of a person, company, organization, or place"]
#[doc = r""]
#[doc = r" <details><summary>JSON schema</summary>"]
Expand Down Expand Up @@ -192,11 +177,6 @@ pub struct Veggies {
#[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
pub vegetables: ::std::vec::Vec<Veggie>,
}
impl ::std::convert::From<&Veggies> for Veggies {
fn from(value: &Veggies) -> Self {
value.clone()
}
}
impl ::std::default::Default for Veggies {
fn default() -> Self {
Self {
Expand Down
12 changes: 0 additions & 12 deletions typify-impl/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1489,12 +1489,6 @@ mod tests {
Err(::std::string::String),
}

impl ::std::convert::From<&Self> for ResultX {
fn from(value: &ResultX) -> Self {
value.clone()
}
}

impl ::std::convert::From<u32> for ResultX {
fn from(value: u32) -> Self {
Self::Ok(value)
Expand Down Expand Up @@ -1541,12 +1535,6 @@ mod tests {
Err(::std::string::String),
}

impl ::std::convert::From<&Self> for ResultX {
fn from(value: &ResultX) -> Self {
value.clone()
}
}

impl ::std::convert::From<u32> for ResultX {
fn from(value: u32) -> Self {
Self::Ok(value)
Expand Down
55 changes: 0 additions & 55 deletions typify-impl/src/type_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,15 +868,6 @@ impl TypeEntry {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for #type_name {
type Error = self::error::ConversionError;

fn try_from(value: &::std::string::String) ->
::std::result::Result<Self, self::error::ConversionError>
{
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for #type_name {
type Error = self::error::ConversionError;

Expand Down Expand Up @@ -934,15 +925,6 @@ impl TypeEntry {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for #type_name {
type Error = self::error::ConversionError;

fn try_from(value: &::std::string::String) ->
::std::result::Result<Self, self::error::ConversionError>
{
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for #type_name {
type Error = self::error::ConversionError;

Expand Down Expand Up @@ -1082,12 +1064,6 @@ impl TypeEntry {
#(#variants_decl)*
}

impl ::std::convert::From<&Self> for #type_name {
fn from(value: &#type_name) -> Self {
value.clone()
}
}

#simple_enum_impl
#default_impl
#untagged_newtype_from_string_impl
Expand Down Expand Up @@ -1204,12 +1180,6 @@ impl TypeEntry {
pub #prop_name: #prop_type,
)*
}

impl ::std::convert::From<&#type_name> for #type_name {
fn from(value: &#type_name) -> Self {
value.clone()
}
}
},
);

Expand Down Expand Up @@ -1421,16 +1391,6 @@ impl TypeEntry {
value.parse()
}
}
impl ::std::convert::TryFrom<&String> for #type_name {
type Error = <#inner_type_name as
::std::str::FromStr>::Err;

fn try_from(value: &String) ->
::std::result::Result<Self, Self::Error>
{
value.parse()
}
}
impl ::std::convert::TryFrom<String> for #type_name {
type Error = <#inner_type_name as
::std::str::FromStr>::Err;
Expand Down Expand Up @@ -1596,15 +1556,6 @@ impl TypeEntry {
value.parse()
}
}
impl ::std::convert::TryFrom<&::std::string::String> for #type_name {
type Error = self::error::ConversionError;

fn try_from(value: &::std::string::String) ->
::std::result::Result<Self, self::error::ConversionError>
{
value.parse()
}
}
impl ::std::convert::TryFrom<::std::string::String> for #type_name {
type Error = self::error::ConversionError;

Expand Down Expand Up @@ -1677,12 +1628,6 @@ impl TypeEntry {
}
}

impl ::std::convert::From<&#type_name> for #type_name {
fn from(value: &#type_name) -> Self {
value.clone()
}
}

#default_impl
#constraint_impl
};
Expand Down
Loading