We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Id
1 parent 2ccb606 commit 7d1f396Copy full SHA for 7d1f396
tools/witx/src/ast.rs
@@ -14,6 +14,30 @@ impl Id {
14
}
15
16
17
+impl AsRef<str> for Id {
18
+ fn as_ref(&self) -> &str {
19
+ self.0.as_ref()
20
+ }
21
+}
22
+
23
+impl PartialEq<&str> for Id {
24
+ fn eq(&self, rhs: &&str) -> bool {
25
+ PartialEq::eq(self.as_ref(), *rhs)
26
27
28
29
+impl PartialEq<Id> for &str {
30
+ fn eq(&self, rhs: &Id) -> bool {
31
+ PartialEq::eq(*self, rhs.as_ref())
32
33
34
35
+impl From<&str> for Id {
36
+ fn from(s: &str) -> Self {
37
+ Self::new(s)
38
39
40
41
#[derive(Debug, Clone)]
42
pub struct Document {
43
definitions: Vec<Definition>,
0 commit comments