Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

Commit

Permalink
ioreg: Fix type mismatches
Browse files Browse the repository at this point in the history
  • Loading branch information
mcoffin committed Jul 31, 2015
1 parent 240d680 commit 9b9901d
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 8 deletions.
1 change: 0 additions & 1 deletion ioreg/src/builder/accessors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use syntax::ptr::P;
use syntax::ext::base::ExtCtxt;
use syntax::ext::build::AstBuilder;
use syntax::ext::quote::rt::ToTokens;
use syntax::parse::token;

use super::Builder;
use super::utils;
Expand Down
5 changes: 2 additions & 3 deletions ioreg/src/builder/getter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use syntax::ext::base::ExtCtxt;
use syntax::codemap::{respan, Span};
use syntax::ext::build::AstBuilder;
use syntax::ext::quote::rt::ToTokens;
use syntax::parse::token;

use super::Builder;
use super::super::node;
Expand Down Expand Up @@ -75,8 +74,8 @@ fn build_type(cx: &ExtCtxt, path: &Vec<String>,
.expect("Unexpected non-primitive register");
let name = utils::getter_name(cx, path);
let reg_doc = match reg.docstring {
Some(d) => d.node.name.as_str(),
None => "no documentation".to_string(),
Some(d) => String::from(d.node.name.as_str().deref()),
None => String::from("no documentation"),
};
let docstring = format!("`{}`: {}", reg.name.node, reg_doc);
let doc_attr = utils::doc_attribute(cx, utils::intern_string(cx, docstring));
Expand Down
3 changes: 1 addition & 2 deletions ioreg/src/builder/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use syntax::codemap::{respan, mk_sp};
use syntax::ext::base::ExtCtxt;
use syntax::ext::build::AstBuilder;
use syntax::ext::quote::rt::ToTokens;
use syntax::parse::token;

use super::Builder;
use super::utils;
Expand Down Expand Up @@ -138,7 +137,7 @@ fn build_reg_struct(cx: &ExtCtxt, path: &Vec<String>,
fn build_enum_variant(cx: &ExtCtxt, variant: &node::Variant)
-> ast::Variant {
let doc = match variant.docstring {
Some(d) => d.node.nameto_string(),
Some(d) => d.node.name.to_string(),
None => "no documentation".to_string(),
};
let docstring = format!("`0x{:x}`. {}",
Expand Down
1 change: 0 additions & 1 deletion ioreg/src/builder/setter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use syntax::ptr::P;
use syntax::ext::base::ExtCtxt;
use syntax::ext::build::AstBuilder;
use syntax::ext::quote::rt::ToTokens;
use syntax::parse::token;

use super::Builder;
use super::super::node;
Expand Down
1 change: 0 additions & 1 deletion ioreg/src/builder/union.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use syntax::ast_util::empty_generics;
use syntax::codemap::{DUMMY_SP, dummy_spanned, respan, Spanned};
use syntax::ext::base::ExtCtxt;
use syntax::ext::build::AstBuilder;
use syntax::parse::token;

use node;
use super::Builder;
Expand Down

0 comments on commit 9b9901d

Please sign in to comment.