inlinevoid
u/inlinevoid
Problem
I'd like to increase the rate my mouse wheel scrolls pages, and I'd like to do it system-wide. It's too slow in every application.
I have a Logitech G400s Wired Mouse. My distro is Void Linux.
What I've tried
I've checked xinput for some sort of scroll speed property, but there doesn't appear to be any.
Device 'Logitech G400s Optical Gaming Mouse':
Device Enabled (144): 1
Coordinate Transformation Matrix (146): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Natural Scrolling Enabled (279):
Selling an EVGA GeForce GTX 1060 SC GAMING. It's never been used; still in the factory shrink wrap. Looking for $250 shipped.
I'm tired, but I feel like the compiler is wrong here.
#[macro_use]
extern crate serde_derive;
extern crate serde;
extern crate bincode;
fn foo<T>(t: &T) where T: serde::ser::Serialize {
let encoded: Vec<u8> = bincode::serialize(t, bincode::Infinite).unwrap();
}
On nightly, errors with:
error[E0277]: the trait bound `T: serde::ser::Serialize` is not satisfied
--> /foo/src/lib.rs:7:28
|
7 | let encoded: Vec<u8> = bincode::serialize(t, bincode::Infinite).unwrap();
| ^^^^^^^^^^^^^^^^^^ the trait `serde::ser::Serialize` is not implemented for `T`
|
= help: consider
For example:
I need to use a few things from a module, foo. foo contains thousands of types, functions, etc.
Would I be taking a significant compile-time hit with use foo::*;? Or should I prefer use foo::{Bar1, Bar2, Bar3, Bar4, Bar5}?
It's not in the docs and it's not obvious to me what the full namespace is.
Sometimes I'd like to panic! if a Result is an Err. Calling unwrap() does that but will print ../src/libcore/result.rs:788 as the source of the panic (which makes sense, but isn't useful to me).
EDIT: So basically
match result {
Ok(result) => result,
Err(e) => panic!(format!("{:?}", e)),
}
As a macro. I'll write one for my own use if it doesn't exist.
EDIT #2: For anyone passing by, this is what I ended up using:
pub trait TryUnwrap {
type Value;
type Error;
fn try_unwrap(self) -> Result<Self::Value, Self::Error>;
}
impl<T> TryUnwrap for Option<T> {
type Value = T;
On https://play.rust-lang.org/ the messages/warnings/errors output when building with nightly are looking way better.
I've got the most recent update of nightly Rust on Windows but it's still the same old formatting. Is it possible to get the new formatting yet?
I'm mainly a C++/C# programmer and I'm so used to:
- being able to look at memory on break/crash
- toggle breakpoints with one click
- get stacktraces on crash
I program in Rust on Windows using Sublime Text and I've been getting by with just using #[derive(Debug)] and println!.
Is there anything that can offer me what I'm used to with Visual Studio?
Haven't played since beta started and groups were removed. Are they back in yet?
I'm writing a really simple program that's essentially:
fn main() {
while(true) {
let data = read_file("foo.txt");
process_data(&data);
std::thread::sleep_ms(5000);
}
}
I'm really new to Rust, but it's my understanding that if my program compiles and I'm not using unsafe code, there shouldn't really be a memory leak. Yet, my program starts off at 0.6mb~ and steadily grows.
There are a few other posts on r/rust experiencing the same thing but no concrete answers as to why that happens. So here's another thread asking: anyone know the cause?
EDIT Here's the full code: https://gist.github.com/anonymous/4c6d5ebbd7d9879e64e7
It's super messy a