Register
be an enum, maybe? Register
be an enum, maybe? SmallString
, a String
-like container for small strings#[derive(Copy)]
. the impl Register
don't have to take &self
but can take self
then&'static str
instead of &str
.clone()
thereBox<&Register>
but we don't do heap hereexpr
?Genkernel should only be considered by users that have a required need that only Genkernel can meet, otherwise it is recommended to use the Distribution kernel or manually compile your own as it will make maintaining a Gentoo system a lot more simple.
Genkernel should only be considered by users that have a required need that only Genkernel can meet, otherwise it is recommended to use the Distribution kernel or manually compile your own as it will make maintaining a Gentoo system a lot more simple.
From
impl is not good. it should probably be a TryFrom
From
impl is not good. it should probably be a TryFrom
From
From
From
Into
.From
trait is intended for perfect conversions. If the conversion can fail or is not perfect, use TryFrom
.From
trait is intended for perfect conversions. If the conversion can fail or is not perfect, use TryFrom
.unreachable!()
which only compiles if the compiler can prove it ^^From
:] The conversion is infallible: if the conversion can fail, use TryFrom
instead; don’t provide a From
impl that panics.From
:] The conversion is infallible: if the conversion can fail, use TryFrom
instead; don’t provide a From
impl that panics.unsafe
stuff, I think (edited)unwrap
unwrap
is not a thing)no_panic
From
impl, then it's a bug. but that's what panics are for: bugsfn from
that is not the traitfn from
that is not the trait no_panic
, you can basically walk up from panic!
and color until you hit any function manually annotated no_panic
where the user has guaranteed that it won't panicno_panic
, you can basically walk up from panic!
and color until you hit any function manually annotated no_panic
where the user has guaranteed that it won't panic assert!
checks, etc.?assert!
s getting optimized outmust
there is in order though, should
sounds too weak, though tbf idk the definitions of those words rust documentation uses)assert!
s getting optimized out if x < v.len() return v[x]
but anything more complicated and there is a loot of peeking into functions required which is not easy (perhaps impossible without some manual annotations)Languages that support exception handling typically provide a throw operation to initiate the exception process. Internally, a throw operation breaks down into two steps.
A request is made to allocate exception space for an exception structure. This structure needs to survive beyond the current activation. This structure will contain the type and value of the object being thrown.
A call is made to the runtime to raise the exception, passing the exception structure as an argument.
In C++, the allocation of the exception structure is done by the __cxa_allocate_exception runtime function. The exception raising is handled by __cxa_throw. The type of the exception is represented using a C++ RTTI structure.
(edited)Languages that support exception handling typically provide a throw operation to initiate the exception process. Internally, a throw operation breaks down into two steps.
A request is made to allocate exception space for an exception structure. This structure needs to survive beyond the current activation. This structure will contain the type and value of the object being thrown.
A call is made to the runtime to raise the exception, passing the exception structure as an argument.
In C++, the allocation of the exception structure is done by the __cxa_allocate_exception runtime function. The exception raising is handled by __cxa_throw. The type of the exception is represented using a C++ RTTI structure.
(edited)let mut guard = self.guarded_stuff.lock();
guard.some_vec.push(val);
drop(guard);
if true {
self.some_async_func().await;
}
compile error (mutex guard cannot be hold accross async calls)
vs.
{
let mut guard = self.guarded_stuff.lock();
guard.some_vec.push(val);
}
if true {
self.some_async_func().await;
}
workslet mut guard = self.guarded_stuff.lock();
guard.some_vec.push(val);
drop(guard);
if true {
self.some_async_func().await;
}
compile error (mutex guard cannot be hold accross async calls)
vs.
{
let mut guard = self.guarded_stuff.lock();
guard.some_vec.push(val);
}
if true {
self.some_async_func().await;
}
works let mut guard = self.guarded_stuff.lock();
guard.some_vec.push(val);
drop(guard);
if true {
self.some_async_func().await;
}
compile error (mutex guard cannot be hold accross async calls)
vs.
{
let mut guard = self.guarded_stuff.lock();
guard.some_vec.push(val);
}
if true {
self.some_async_func().await;
}
works let mut guard = self.guarded_stuff.lock();
guard.some_vec.push(val);
drop(guard);
if true {
self.some_async_func().await;
}
compile error (mutex guard cannot be hold accross async calls)
vs.
{
let mut guard = self.guarded_stuff.lock();
guard.some_vec.push(val);
}
if true {
self.some_async_func().await;
}
works error[E0277]: `*mut ()` cannot be sent between threads safely
(edited)1 new mention
==
%d new mentions
==
9+ new mentions
==
Why? Because we have multiple grammatical numbers:
1 mention = 1 згадка
2~4 mentions = 2~4 згадки
5~20 mentions = 5~20 згадок
After 20 the cycle repeats
21 mentions = 21 згадка
22~24 mentions = 22~24 згадки
25~30 mentions = 25~30 згадок
31 mentions = 31 згадка
32~34 mentions = 32~34 згадки
35~40 mentions = 35~40 згадок
And so on and so forth...1 new mention
==
%d new mentions
==
9+ new mentions
==
Why? Because we have multiple grammatical numbers:
1 mention = 1 згадка
2~4 mentions = 2~4 згадки
5~20 mentions = 5~20 згадок
After 20 the cycle repeats
21 mentions = 21 згадка
22~24 mentions = 22~24 згадки
25~30 mentions = 25~30 згадок
31 mentions = 31 згадка
32~34 mentions = 32~34 згадки
35~40 mentions = 35~40 згадок
And so on and so forth... %d out of %d servers
and %d out of 1 server
(not the real case), what do you propose these become? (edited)Localize
decide which one to use?PluralLocalize(i, "%d out of %d server", "%d out of %d servers")
GetTileIndex
and GetFTileIndex
?CTile::m_Index
you just need to be checking the correct layerGetTileIndex
and GetFTileIndex
? GetTile
New mentions: x
%i minute left
%i minutes left
%i second left
%i seconds left
and with
%d of %d server
%d of %d servers
%d player
%d players
Laser
is used in both Controls tab (where it stands for "Laser Rifle`) and in Appearance tab. Well..