mirror of
https://github.com/tweag/nickel.git
synced 2024-09-20 16:08:14 +03:00
Implment Into<String> for Ident
This commit is contained in:
parent
2653a69fff
commit
3f87e3052f
@ -4,8 +4,9 @@ use std::{fmt, hash::Hash};
|
||||
|
||||
use crate::position::TermPos;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Ident(pub String, #[serde(skip)] pub Option<TermPos>);
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
#[serde(into = "String", from = "String")]
|
||||
pub struct Ident(pub String, pub Option<TermPos>);
|
||||
|
||||
impl PartialOrd for Ident {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
|
||||
@ -48,3 +49,9 @@ where
|
||||
Ident(String::from(val), None)
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<String> for Ident {
|
||||
fn into(self) -> String {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user