Skip to content

Commit 8397117

Browse files
committed
working on general type design
1 parent ef5f7b6 commit 8397117

File tree

7 files changed

+271
-142
lines changed

7 files changed

+271
-142
lines changed

codegen/src/api/gen/rust.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -73,35 +73,6 @@ impl From<String> for ApiGenError {
7373
}
7474

7575
impl api::Endpoint {
76-
/// Get the Rust doc comment for this endpoint.
77-
///
78-
/// This is the `documentation` value formatted as a Rust doc comment.
79-
pub fn get_doc(&self) -> Attribute {
80-
Spanned {
81-
span: DUMMY_SP,
82-
node: Attribute_ {
83-
id: AttrId(0),
84-
style: AttrStyle::Inner,
85-
value: P(Spanned {
86-
span: DUMMY_SP,
87-
node: MetaItemKind::NameValue(
88-
token::InternedString::new(""),
89-
Spanned {
90-
span: DUMMY_SP,
91-
node: LitKind::Str(
92-
token::InternedString::new_from_name(
93-
token::intern(&format!("//! {}", self.documentation))
94-
),
95-
StrStyle::Cooked
96-
)
97-
}
98-
)
99-
}),
100-
is_sugared_doc: true
101-
}
102-
}
103-
}
104-
10576
/// Gets the name of the Endpoint if it's set or returns an empty string.
10677
pub fn get_name<'a>(&'a self) -> &'a str {
10778
match self.name {

codegen/tests/api_gen.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -102,27 +102,6 @@ fn can_get_api_type_as_rust_type() {
102102
assert!(success);
103103
}
104104

105-
#[test]
106-
fn can_get_rust_doc_comment_for_endpoint() {
107-
let endpoint = Endpoint {
108-
name: None,
109-
documentation: "My docs".to_string(),
110-
methods: Vec::new(),
111-
body: None,
112-
url: Url {
113-
path: String::new(),
114-
paths: Vec::new(),
115-
parts: BTreeMap::new(),
116-
params: BTreeMap::new()
117-
}
118-
};
119-
120-
let docs = endpoint.get_doc();
121-
122-
//TODO: Get the '///' or '//!' prepended
123-
assert_eq!("//! My docs", pprust::attr_to_string(&docs));
124-
}
125-
126105
#[test]
127106
fn can_get_mod_name_for_endpoint() {
128107
let endpoint = Endpoint {

0 commit comments

Comments
 (0)