diff options
| author | Philipp A | 2018-12-28 16:40:44 +0100 | 
|---|---|---|
| committer | Philipp A | 2018-12-28 16:40:44 +0100 | 
| commit | 8b16dfaa7cad8cb8a666fcc75a63861b37925d69 (patch) | |
| tree | d2d6bb815a73f2dd2b1db79b442473bd4c440b34 /src/document_tree | |
| parent | 447ecb7945e091e52218d50a701e82f29ad6663d (diff) | |
| download | rust-rst-8b16dfaa7cad8cb8a666fcc75a63861b37925d69.tar.bz2 | |
Add From<&str> for ID and AT
Diffstat (limited to 'src/document_tree')
| -rw-r--r-- | src/document_tree/attribute_types.rs | 12 | 
1 files changed, 12 insertions, 0 deletions
| diff --git a/src/document_tree/attribute_types.rs b/src/document_tree/attribute_types.rs index dc245b5..ba631d9 100644 --- a/src/document_tree/attribute_types.rs +++ b/src/document_tree/attribute_types.rs @@ -51,6 +51,18 @@ impl FromStr for AlignHV {  	}  } +impl From<&str> for ID { +	fn from(s: &str) -> Self { +		ID(s.to_owned().replace(' ', "-")) +	} +} + +impl From<&str> for NameToken { +	fn from(s: &str) -> Self { +		NameToken(s.to_owned()) +	} +} +  impl FromStr for Measure {  	type Err = Error;  	fn from_str(s: &str) -> Result<Self, Self::Err> { | 
