Skip to content

Commit f20e08f

Browse files
committed
Fix cargo clippy
1 parent 6d23345 commit f20e08f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

aiscript-vm/src/builtins/format.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,21 +158,21 @@ impl FormatSpec {
158158

159159
match self.align.unwrap_or('>') {
160160
'<' => {
161-
formatted.extend(std::iter::repeat(fill_char).take(padding));
161+
formatted.extend(std::iter::repeat_n(fill_char, padding));
162162
}
163163
'>' => {
164164
let mut new_string = String::new();
165-
new_string.extend(std::iter::repeat(fill_char).take(padding));
165+
new_string.extend(std::iter::repeat_n(fill_char, padding));
166166
new_string.push_str(&formatted);
167167
formatted = new_string;
168168
}
169169
'^' => {
170170
let left_pad = padding / 2;
171171
let right_pad = padding - left_pad;
172172
let mut new_string = String::new();
173-
new_string.extend(std::iter::repeat(fill_char).take(left_pad));
173+
new_string.extend(std::iter::repeat_n(fill_char, left_pad));
174174
new_string.push_str(&formatted);
175-
new_string.extend(std::iter::repeat(fill_char).take(right_pad));
175+
new_string.extend(std::iter::repeat_n(fill_char, right_pad));
176176
formatted = new_string;
177177
}
178178
_ => unreachable!(),

aiscript-vm/src/vm/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl<'gc> State<'gc> {
166166

167167
pub fn import_module(&mut self, path: InternedString<'gc>) -> Result<(), VmError> {
168168
// Get the simple name (last component) from the path
169-
let simple_name = path.to_str().unwrap().split('.').last().unwrap();
169+
let simple_name = path.to_str().unwrap().split('.').next_back().unwrap();
170170
let simple_name = self.intern(simple_name.as_bytes());
171171

172172
// Check if simple name is already used

0 commit comments

Comments
 (0)