Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kraigher committed Sep 8, 2023
1 parent 36c9ca7 commit c3409d9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
11 changes: 9 additions & 2 deletions vhdl_lang/src/analysis/names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -960,8 +960,15 @@ impl<'a> AnalyzeContext<'a> {
) -> EvalResult<TypeEnt<'a>> {
// all type attribute suffixes require that the prefix be an object type
let Some(obj) = prefix.as_object_name() else {
diagnostics.error(pos,format!("The {} attribute can only be used on objects, not {}", suffix, prefix.describe()));
return Err(EvalError::Unknown)
diagnostics.error(
pos,
format!(
"The {} attribute can only be used on objects, not {}",
suffix,
prefix.describe()
),
);
return Err(EvalError::Unknown);
};
match suffix {
TypeAttribute::Subtype => Ok(obj.type_mark()),
Expand Down
5 changes: 1 addition & 4 deletions vhdl_lang/src/data/contents.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ impl Contents {

let end_line = std::cmp::min(self.lines.len().saturating_sub(1), end_line);
self.lines
.splice(
start_line..=end_line,
split_lines(&merged_content),
)
.splice(start_line..=end_line, split_lines(&merged_content))
.count();
}
}
Expand Down
6 changes: 4 additions & 2 deletions vhdl_lang/src/syntax/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ mod tests {

#[test]
fn test_context_clause() {
let variants = [&"\
let variants = [
&"\
context ident is
end;
",
Expand All @@ -231,7 +232,8 @@ end ident;
&"\
context ident is
end context ident;
"];
",
];
for (idx, variant) in variants.iter().enumerate() {
let has_end_ident = idx >= 2;
let code = Code::new(variant);
Expand Down

0 comments on commit c3409d9

Please sign in to comment.