Skip to content

Instantly share code, notes, and snippets.

@metasim
Created March 7, 2022 14:38
Show Gist options
  • Save metasim/d05f7b305752a08411efc3674c61cc2f to your computer and use it in GitHub Desktop.
Save metasim/d05f7b305752a08411efc3674c61cc2f to your computer and use it in GitHub Desktop.
Error reporting bug in JetBrains Rust Plugin
[package]
name = "ext-err"
version = "0.1.0"
edition = "2021"
[dependencies]
extend = "1.1.2"
use extend::ext;
#[ext]
impl<T> Vec<T> {
fn scramble(mut self) -> Self {
let len = self.len();
self.swap(0, len/2);
self
}
}
fn main() {
let nums = vec![1, 2, 3, 4, 5];
println!("{:?}", nums.scramble());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment