Skip to content

Commit

Permalink
bump: rust 1.47
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Oct 10, 2020
1 parent d806389 commit 640d94e
Show file tree
Hide file tree
Showing 13 changed files with 172 additions and 338 deletions.
10 changes: 2 additions & 8 deletions crates/mun_abi/src/type_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,12 @@ unsafe impl Sync for TypeInfo {}
impl TypeGroup {
/// Returns whether this is a fundamental type.
pub fn is_fundamental(self) -> bool {
match self {
TypeGroup::FundamentalTypes => true,
_ => false,
}
self == TypeGroup::FundamentalTypes
}

/// Returns whether this is a struct type.
pub fn is_struct(self) -> bool {
match self {
TypeGroup::StructTypes => true,
_ => false,
}
self == TypeGroup::StructTypes
}
}

Expand Down
5 changes: 1 addition & 4 deletions crates/mun_compiler/src/driver/display_color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ impl DisplayColor {
/// Decides whether the current terminal supports ANSI escape codes based on the `term` environment variable and the operating system.
fn terminal_support_ansi() -> bool {
let supports_color = match env::var("TERM") {
Ok(terminal) => match terminal.as_str() {
"dumb" => false,
_ => true,
},
Ok(terminal) => terminal.as_str() == "dumb",
Err(_) => {
#[cfg(target_os = "windows")]
let term_support = cmd_supports_ansi();
Expand Down
1 change: 1 addition & 0 deletions crates/mun_hir/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ pub fn resolver_for_expr(body: Arc<Body>, db: &dyn HirDatabase, expr_id: ExprId)
resolver_for_scope(body, db, scopes.scope_for(expr_id))
}

#[allow(clippy::needless_collect)] // false positive https://github.com/rust-lang/rust-clippy/issues/5991
pub(crate) fn resolver_for_scope(
body: Arc<Body>,
db: &dyn HirDatabase,
Expand Down
10 changes: 2 additions & 8 deletions crates/mun_hir/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ impl Ty {
}

pub fn is_never(&self) -> bool {
match self.as_simple() {
Some(TypeCtor::Never) => true,
_ => false,
}
self.as_simple() == Some(TypeCtor::Never)
}

/// Returns the callable definition for the given expression or `None` if the type does not
Expand Down Expand Up @@ -185,10 +182,7 @@ impl Ty {

/// Returns true if this instance represents a known type.
pub fn is_known(&self) -> bool {
match self {
Ty::Unknown => false,
_ => true,
}
*self == Ty::Unknown
}
}

Expand Down
10 changes: 2 additions & 8 deletions crates/mun_hir/src/ty/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,11 @@ impl_froms!(CallableDef: Function, Struct);

impl CallableDef {
pub fn is_function(self) -> bool {
match self {
CallableDef::Function(_) => true,
_ => false,
}
matches!(self, CallableDef::Function(_))
}

pub fn is_struct(self) -> bool {
match self {
CallableDef::Struct(_) => true,
_ => false,
}
matches!(self, CallableDef::Struct(_))
}
}

Expand Down
8 changes: 4 additions & 4 deletions crates/mun_syntax/src/ast/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ impl ast::PathSegment {
}

pub fn has_colon_colon(&self) -> bool {
match self.syntax.first_child_or_token().map(|s| s.kind()) {
Some(T![::]) => true,
_ => false,
}
matches!(
self.syntax.first_child_or_token().map(|s| s.kind()),
Some(T![::])
)
}
}

Expand Down
Loading

0 comments on commit 640d94e

Please sign in to comment.