Skip to content

Commit

Permalink
upgrade rustdoc-types
Browse files Browse the repository at this point in the history
  • Loading branch information
wfraser committed Jul 14, 2024
1 parent e454e5c commit 9a58a73
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rsbrowse"
version = "0.2.7"
version = "0.2.8"
authors = ["Bill Fraser <bill@wfraser.dev>"]
description = "an interactive browser for the contents of Rust crates"
edition = "2021"
Expand All @@ -12,7 +12,7 @@ indicatif = "0.17.7"
lazy_static = "1"
log = "0.4"
rayon = "1.8.0"
rustdoc-types = "0.24.0"
rustdoc-types = "0.27.0"
serde_json = "1.0"
tempfile = "3.8.1"

Expand Down
3 changes: 2 additions & 1 deletion src/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ impl Analysis {
}
TypeAlias(ty) => type_ids(&ty.type_),
OpaqueTy(_) => vec![],
Constant(_) => vec![],
Constant { type_, .. } => type_ids(type_),
Static(_) => vec![],
ForeignType => vec![],
Macro(_) => vec![],
Expand Down Expand Up @@ -326,6 +326,7 @@ pub fn type_ids(ty: &rustdoc_types::Type) -> Vec<&rustdoc_types::Id> {
from_self
}
}
Pat { type_, .. } => type_ids(type_),
}
}

Expand Down
5 changes: 3 additions & 2 deletions src/browser_rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl RustdocBrowser {
}
TypeAlias(_) => "type",
OpaqueTy(_) => "opaque type",
Constant(c) => return format!("const {}: {}", name, type_label(&c.type_)),
Constant { type_, const_: _ } => return format!("const {}: {}", name, type_label(type_)),
Static(s) => return format!("static {}: {}", name, type_label(&s.type_)),
ForeignType => "extern type",
Macro(_) => "macro",
Expand Down Expand Up @@ -228,7 +228,7 @@ impl<'a> Browser for &'a RustdocBrowser {
match item {
Item::Item(item) => {
if let Some(docs) = &item.docs {
txt += &docs;
txt += docs;
txt.push('\n');
}
if let Some(span) = &item.span {
Expand Down Expand Up @@ -454,5 +454,6 @@ fn type_label(ty: &rustdoc_types::Type) -> String {
format!("{}::{name}", type_label(self_type))
}
}
Pat { type_, .. } => type_label(type_),
}
}

0 comments on commit 9a58a73

Please sign in to comment.