profile
viewpoint

gaenserich/hostsblock 205

an ad- and malware-blocking script for Linux

pickfire/babelfish 8

Universal translater for encodings

pickfire/apu_tt 3

APU Timetable CLI

georgeblu1/FreshGrade 1

Fruit grading classification using Keras

pickfire/bugs 1

Game with lots of bugs (catch them yourselves or ask a bot)

aickathon2018/teams 0

Upload your codes here by 8:30 AM, Nov 18, 2018. The repository name should be your team name.

almondheng/cargo-mana 0

Demo of object tracking and motion tracking to detect boxes

issue commenthecrj/iced

Hot reloading of layout

https://fasterthanli.me/articles/so-you-want-to-live-reload-rust maybe related? We could even hot reload the whole application.

PvdBerg1998

comment created time in 36 minutes

pull request commentrust-lang/rust

When arriving on a search result page, we want to focus on the search…

Yes, it's still there. Steps to reproduce (I use firefox on mobile):

  1. go to search page
  2. type something to search
  3. blue the search (keyboard lowers)
  4. you cannot click on search bar anymore

Oh, I just found out that it work except the click position is way out, you need to touch the corner of the screen rather than the center of the box itself.

Okay, this pull request does not fix the issue I mentioned.

GuillaumeGomez

comment created time in an hour

pull request commentrust-lang/rust

When arriving on a search result page, we want to focus on the search…

That seems like it's a separate bug to fix. Does that mean you can't search at all on mobile?

No, you can search exactly once but not more than that. Once you searched, you need to go back and come back or reload the page IIRC.

GuillaumeGomez

comment created time in 10 hours

pull request commentrust-lang/rust

When arriving on a search result page, we want to focus on the search…

IIRC in the mobile you cannot even open the keyboard if the search bar is not focused in the first place, I thought the patch is a fix for it.

GuillaumeGomez

comment created time in 10 hours

push eventpickfire/kakoune

Ivan Tham

commit sha bfca07da4d52b821c67a5b4e3eb056df9d98bd55

Rust not to indent on hash

view details

push time in 10 hours

issue commentrust-lang/rust

Give a better diagnostic for keywords with incorrect capitalization

@hosseind75 I am also a bit now on this but my guess is that this is probably not a very easy task to begin with.

Or maybe check in compiler/rustc_parse/src/parser/expr.rs or somewhere around there? My guess is somewhere around parse_lit but maybe @estebank can give you a more detailed mentor instructions.

jyn514

comment created time in 10 hours

pull request commentrust-lang/rust

Alloc vec use imported path

Uh, why are you doing a dozen PRs to make tiny changes to my specialization PR? You could have reviewed it when it was open for months, then I could have finished it immediately worried

Yeah, I wonder why all my PRs is related to your PR. I wish it could reviewed it last time but probably I missed it, by the time I saw it it was already merged. Since I was copying word by word on vec for one of my project so I easily noticed the typos. Feel free to ping to regarding vec next time, at least I don't need to send so many PRs.

pickfire

comment created time in 10 hours

issue commentivanceras/sauron

Benchmarks are misleading and need to be updated.

I would be interested to see a comparison with vue 3 release too.

awulkan

comment created time in 11 hours

issue openedivanceras/sauron-native

Difference from iced?

Iced is built from scratch to support multiple platforms, how is sauron-native compared to it?

created time in 11 hours

startedivanceras/sauron-native

started time in 11 hours

Pull request review commentrust-lang/rust

Fix typo in alloc vec comment

 where          // use try-fold since         // - it vectorizes better for some iterator adapters-        // - unlike most internal iteration methods methods it only takes a &mut self+        // - unlike most internal iteration methods, it only takes a &mut self         // - it lets us thread the write pointer through its innards and get it back in the end

thread the write pointer through its innards

pickfire

comment created time in 12 hours

PullRequestReviewEvent

PR opened rust-lang/rust

Alloc vec use imported path

mem::ManuallyDrop::new -> ManuallyDrop::new

+1 -1

0 comment

1 changed file

pr created time in 12 hours

push eventpickfire/rust

Ivan Tham

commit sha f9b625f8e004cebdc79f891dea3fb128ec663151

Alloc vec use imported path mem::ManuallyDrop::new -> ManuallyDrop::new

view details

push time in 12 hours

Pull request review commentrust-lang/rust

Fix typo in alloc vec comment

 where          // use try-fold since         // - it vectorizes better for some iterator adapters-        // - unlike most internal iteration methods methods it only takes a &mut self+        // - unlike most internal iteration methods, it only takes a &mut self         // - it lets us thread the write pointer through its innards and get it back in the end

Is this even valid? Looks weird to me.

pickfire

comment created time in 12 hours

PullRequestReviewEvent

PR opened rust-lang/rust

Fix typo in alloc vec comment

cc @the8472

+1 -1

0 comment

1 changed file

pr created time in 12 hours

push eventpickfire/rust

Ivan Tham

commit sha b141e49d8702fa170953aed388eb1510622db79b

Fix typo in alloc vec comment

view details

push time in 12 hours

pull request commentrust-lang/rust

Always use the Rust version in package names

Nice but wouldn't rust release indicate that all of the other packages released?

pietroalbini

comment created time in 12 hours

Pull request review commentrust-lang/rust

Tweak `if let` suggestion to be more liberal with suggestion and to not ICE

 impl<'a, 'tcx> FnCtxt<'a, 'tcx> {             let mut err = self.demand_suptype_diag(expr.span, expected_ty, actual_ty).unwrap();             let lhs_ty = self.check_expr(&lhs);             let rhs_ty = self.check_expr(&rhs);-            if self.can_coerce(lhs_ty, rhs_ty) {-                if !lhs.is_syntactic_place_expr() {-                    // Do not suggest `if let x = y` as `==` is way more likely to be the intention.-                    if let hir::Node::Expr(hir::Expr {-                        kind: ExprKind::Match(_, _, hir::MatchSource::IfDesugar { .. }),-                        ..-                    }) = self.tcx.hir().get(-                        self.tcx.hir().get_parent_node(self.tcx.hir().get_parent_node(expr.hir_id)),-                    ) {-                        // Likely `if let` intended.-                        err.span_suggestion_verbose(-                            expr.span.shrink_to_lo(),-                            "you might have meant to use pattern matching",-                            "let ".to_string(),-                            Applicability::MaybeIncorrect,-                        );-                    }+            let (mut msg, applicability, eq) = if self.can_coerce(rhs_ty, lhs_ty) {+                ("likely", Applicability::MachineApplicable, true)+            } else {+                ("might have", Applicability::MaybeIncorrect, false)

I wonder if Applicability::MaybeIncorrect should have a Display or some sort to convert to text. Still likely feels weird, I see another alternative is probably which may be a bit better (my two cents).

estebank

comment created time in 13 hours

PullRequestReviewEvent

pull request commentrust-lang/rust

Detect async visibility wrong order, `async pub`

@estebank Can you please help to review again?

pickfire

comment created time in 13 hours

PullRequestReviewEvent

pull request commentrust-lang/rust

Reorder benches const variable

@pickfire change once instead of [0].iter() after this.

@rustbot modify labels: +C-cleanup +A-testsuite

pickfire

comment created time in 13 hours

PR opened rust-lang/rust

Reorder benches const variable

Move LEN so it is is read in order.

+2 -2

0 comment

1 changed file

pr created time in 13 hours

push eventpickfire/rust

Ivan Tham

commit sha 55ba9e4755eb47555417c311b867bce6196da462

Reorder benches const variable Move LEN so it is is read in order.

view details

push time in 13 hours

delete branch pickfire/rust

delete branch : patch-4

delete time in 13 hours

GollumEvent

PR opened kak-lsp/kak-lsp

Add yaml language server
+6 -0

0 comment

1 changed file

pr created time in 20 hours

push eventpickfire/kak-lsp

Ivan Tham

commit sha 7763b141e43ba4cb0b75b85040026bd16fa28d96

Add yaml language server

view details

push time in 20 hours

issue commentkubernetes/kubectl

Please add fish completion

Another approach would be to ship automatically generated manpages as fish will parse those as well.

Kubectl man pages is neither human readable nor fish-manpage-completions parsable.

I use https://gist.github.com/terlar/28e1c2e4ac9a27be7a5950306bf45ab2 in the meantime.

wgordon17

comment created time in 20 hours

push eventpickfire/dotfiles

Ivan Tham

commit sha 0ff3451fd60bbf36df26aa16932000d47c47de8e

Add more CJK fonts support

view details

push time in a day

push eventpickfire/dotfiles

Ivan Tham

commit sha 55bf5d547b993bdc09808396c38f503757e5ec76

Update fcitx config

view details

Ivan Tham

commit sha 1e8d204c13511d4abf00a5188f7b5222188282cd

Add fcitx5-dwm-theme

view details

push time in a day

create barnchpickfire/fcitx5-dwm-theme

branch : master

created branch time in a day

created repositorypickfire/fcitx5-dwm-theme

Fcitx5 dwm theme

created time in a day

delete branch pickfire/rust

delete branch : patch-7

delete time in a day

Pull request review commentrust-lang/rust

Uplift `temporary-cstring-as-ptr` lint from `clippy` into rustc

+// ignore-tidy-linelength+// this program is not technically incorrect, but is an obscure enough style to be worth linting+#![deny(temporary_cstring_as_ptr)]++use std::ffi::CString;++fn main() {+    let s = CString::new("some text").unwrap().as_ptr(); //~ ERROR getting the inner pointer of a temporary `CString`
// this program is not technically incorrect, but is an obscure enough style to be worth linting
#![deny(temporary_cstring_as_ptr)]

use std::ffi::CString;

fn main() {
    let s = CString::new("some text").unwrap().as_ptr();
    //~^ ERROR getting the inner pointer of a temporary `CString`
nathanwhit

comment created time in a day

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Uplift `temporary-cstring-as-ptr` lint from `clippy` into rustc

+// ignore-tidy-linelength+#![deny(temporary_cstring_as_ptr)]++use std::ffi::CString;++fn some_function(data: *const i8) {}++fn main() {+    some_function(CString::new("").unwrap().as_ptr()); //~ ERROR getting the inner pointer of a temporary `CString`

Why not just remove the ignore tidy linelength check and reduce this line length?

    some_function(CString::new("").unwrap().as_ptr());
    //~^ ERROR getting the inner pointer of a temporary `CString`
nathanwhit

comment created time in a day

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Uplift `temporary-cstring-as-ptr` lint from `clippy` into rustc

 use crate::sys; /// documentation of `CString` before use, as improper ownership management /// of `CString` instances can lead to invalid memory accesses, memory leaks, /// and other memory errors.+

Is this necessary?

nathanwhit

comment created time in a day

PullRequestReviewEvent

startedivanceras/sauron

started time in a day

pull request commentdiesel-rs/diesel

[WIP] Rework benchmarks

cc @fafhrd91 who may be interested in this

weiznich

comment created time in a day

Pull request review commentrust-lang/rust

Add `std::io::input` simple input function.

 impl fmt::Debug for StderrLock<'_> {     } } +/// Reads a [`String`] from [standard input](Stdin). The trailing+/// newline is stripped. Gives an error on EOF (end of file).+///+/// # Note+///+/// If you require more explicit control over capturing+/// user input, see the [`Stdin::read_line`] method.+///+/// # Examples+///+/// ```no_run+/// #![feature(io_input)]+/// use std::io;+///+/// fn main() -> io::Result<()> {+///     print!("Enter name: ");+///+///     let name: String = io::read_line()?;+///+///     println!("Your name is {}!", name);+///+///     Ok(())+/// }+/// ```+#[unstable(+    feature = "io_input",+    reason = "this function may be replaced with a more general mechanism",+    issue = "none"+)]+pub fn read_line() -> Result<String> {+    stdout().flush()?; // print!() does not flush :(+    let mut input = String::new();+    match stdin().read_line(&mut input)? {+        0 => Err(Error::new(ErrorKind::UnexpectedEof, "input reached eof unexpectedly")),+        _ => {+            input.pop();+            #[cfg(windows)]+            input.pop();+            Ok(input)

Shouldn't it return EOF error when this happens?

sHaDoW-54

comment created time in a day

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Revamp rustdoc docs about documentation using `cfg`

 Note: Because of how `macro_rules` macros are scoped in Rust, the intra-doc link These features operate by extending the `#[doc]` attribute, and thus can be caught by the compiler and enabled with a `#![feature(...)]` attribute in your crate. -### Documenting platform-/feature-specific information+### `#[doc(cfg)]`: Recording what platforms or features are required for code to be present

Conditional documentation?

jyn514

comment created time in a day

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Add `std::io::input` simple input function.

 impl fmt::Debug for StderrLock<'_> {     } } +/// Reads a [`String`] from [standard input](Stdin). The trailing+/// newline is stripped. Gives an error on EOF (end of file).+///+/// # Note+///+/// If you require more explicit control over capturing+/// user input, see the [`Stdin::read_line`] method.+///+/// # Examples+///+/// ```no_run+/// #![feature(io_input)]+/// use std::io;+///+/// fn main() -> io::Result<()> {+///     print!("Enter name: ");+///+///     let name: String = io::read_line()?;+///+///     println!("Your name is {}!", name);+///+///     Ok(())+/// }+/// ```+#[unstable(+    feature = "io_input",+    reason = "this function may be replaced with a more general mechanism",+    issue = "none"+)]+pub fn read_line() -> Result<String> {+    stdout().flush()?; // print!() does not flush :(+    let mut input = String::new();+    match stdin().read_line(&mut input)? {+        0 => Err(Error::new(ErrorKind::UnexpectedEof, "input reached eof unexpectedly")),+        _ => {+            if Some('\n') == input.chars().next_back() {

Why not just pop without the checks?

sHaDoW-54

comment created time in a day

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Add `std::io::input` simple input function.

 impl fmt::Debug for StderrLock<'_> {     } } +/// Reads a [`String`] from [standard input](Stdin). The trailing+/// newline is stripped. Gives an error on EOF (end of file).+///+/// # Note+///+/// If you require more explicit control over capturing+/// user input, see the [`Stdin::read_line`] method.+///+/// # Examples+///+/// ```no_run+/// #![feature(io_input)]+/// use std::io;+///+/// fn main() -> io::Result<()> {+///     print!("Enter name: ");+///+///     let name: String = io::read_line()?;+///+///     println!("Your name is {}!", name);+///+///     Ok(())+/// }+/// ```+#[unstable(+    feature = "io_input",+    reason = "this function may be replaced with a more general mechanism",+    issue = "none"+)]+pub fn read_line() -> Result<String> {+    stdout().flush()?; // print!() does not flush :(+    let mut input = String::new();+    match stdin().read_line(&mut input)? {+        0 => Err(Error::new(ErrorKind::UnexpectedEof, "input reached eof unexpectedly")),+        _ => {+            input.pop();

A better choice may be to change the naming to reflect that it does not include the new lines, at least that could solve the problem with naming inconsistency.

But if we keep the line, then people would need to fallback to trim which currently does not return a String in place but &str.

sHaDoW-54

comment created time in a day

PullRequestReviewEvent

issue commentrust-windowing/winit

Tracking issue for CompositionEvent support

Can it commit partially?

murarth

comment created time in a day

startedRustPython/RustPython

started time in a day

pull request commentrust-lang/rust.vim

Dedent on curly braces on other blocks like for

Yes, that's where it moved but I don't understand why. Do you have any idea?

pickfire

comment created time in 2 days

pull request commentrust-lang/rust

Add alias for iterator fold

not sure about inject but it was written in doc there.

I don't know where that comes from either...

Maybe we should remove it?

pickfire

comment created time in 2 days

pull request commentrust-lang/rust.vim

Dedent on curly braces on other blocks like for

Oh no, how come I broke some other parts? T_T

pickfire

comment created time in 2 days

push eventrust-dc/fish-manpage-completions

Ivan Tham

commit sha 716c05d7c2349166cc4a9a375d643a6dba90cdbb

fix(truncated_description): keep lossy_unicode

view details

Ivan Tham

commit sha 1b7d11bdad96f936248e0ea43b399d126e3471d6

refactor: use String::from_utf8_lossy not lossy_unicode

view details

push time in 2 days

Pull request review commentrust-dc/fish-manpage-completions

feat(main): tackling the final 😈 (WIP)

 fn truncated_description(description: &str) -> String {         .split(".")         .filter(|sentence| !sentence.trim().is_empty()); -    let mut out = format!(-        "{}.",-        lossy_unicode(&sentences.next().unwrap_or_default().as_bytes())-    );+    let out = sentences.next().unwrap_or_default().trim_end_matches('.');+    let mut out = lossy_unicode(out.as_bytes());     let mut out_len = char_len(&out);      if out_len > MAX_DESCRIPTION_WIDTH {         out = char_truncate_string(&out, MAX_DESCRIPTION_WIDTH, TRUNCATION_SUFFIX).into_owned();     } else {         for line in sentences {-            let line = lossy_unicode(&line.as_bytes());

I think we could also remove the lossy_unicode since it is always allocating a String, we don't need that when we do only format! for those usage, I use String::from_utf8_lossy(s.as_bytes()) instead.

scooter-dangle

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentrust-dc/fish-manpage-completions

feat(main): tackling the final 😈 (WIP)

 fn truncated_description(description: &str) -> String {         .split(".")         .filter(|sentence| !sentence.trim().is_empty()); -    let mut out = format!(-        "{}.",-        lossy_unicode(&sentences.next().unwrap_or_default().as_bytes())-    );+    let out = sentences.next().unwrap_or_default().trim_end_matches('.');+    let mut out = lossy_unicode(out.as_bytes());     let mut out_len = char_len(&out);      if out_len > MAX_DESCRIPTION_WIDTH {         out = char_truncate_string(&out, MAX_DESCRIPTION_WIDTH, TRUNCATION_SUFFIX).into_owned();     } else {         for line in sentences {-            let line = lossy_unicode(&line.as_bytes());

Oh, you are correct. We need to run it since it was not runned for the other parts of the description.

scooter-dangle

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentrust-dc/fish-manpage-completions

feat(main): tackling the final 😈 (WIP)

 fn truncated_description(description: &str) -> String {         .split(".")         .filter(|sentence| !sentence.trim().is_empty()); -    let mut out = format!(-        "{}.",-        lossy_unicode(&sentences.next().unwrap_or_default().as_bytes())-    );+    let out = sentences.next().unwrap_or_default().trim_end_matches('.');+    let mut out = lossy_unicode(out.as_bytes());     let mut out_len = char_len(&out);      if out_len > MAX_DESCRIPTION_WIDTH {         out = char_truncate_string(&out, MAX_DESCRIPTION_WIDTH, TRUNCATION_SUFFIX).into_owned();     } else {         for line in sentences {-            let line = lossy_unicode(&line.as_bytes());

If I am correct, we already run lossy_unicode when we first loads the file so I think it is unnecessary to do it again. I think it was also called above but I think that could also be removed.

scooter-dangle

comment created time in 2 days

PullRequestReviewEvent

push eventrust-dc/fish-manpage-completions

Ivan Tham

commit sha ff533b71747d73d7c0a00c01972e33e5cebd7edf

fix(truncated_description): truncate last period

view details

push time in 2 days

Pull request review commentrust-dc/fish-manpage-completions

feat(main): tackling the final 😈 (WIP)

 fn truncated_description(description: &str) -> String {         .split(".")         .filter(|sentence| !sentence.trim().is_empty()); -    let mut out = format!(-        "{}.",-        lossy_unicode(&sentences.next().unwrap_or_default().as_bytes())-    );+    let out = sentences.next().unwrap_or_default().trim_end_matches('.');

Oh, I took it from upstream python but I forgot to update the tests. I was wondering why upstream python does not have the trailing . and noticed that ours is probably a bit old. I fixed the behavior to only remove the last period rather than the first one.

scooter-dangle

comment created time in 2 days

PullRequestReviewEvent

push eventpickfire/rust.vim

Ivan Tham

commit sha 4527ff2c63a5e79cc110536765d4e1b213381bd7

Add test for 421

view details

push time in 2 days

push eventpickfire/rust.vim

Ivan Tham

commit sha 2851e87a2d6ff5c8d81ae2c0c64ef4f1ff7255a2

Add test for 421

view details

push time in 2 days

pull request commentrust-lang/rust

Add `std::io::input` simple input function.

@sHaDoW-54 Can you please move the latest changes in stdio to a second pull request? Also, I wonder why the tests was removed (can comment on the other pull request). At least we can keep this pull request only to std::io::input so reviewing can be easier.

sHaDoW-54

comment created time in 2 days

issue commentmawww/kakoune

Regex negate not working when \h is used

Oh, I forgot about it, [^.] matches the previous character which .* should match. Thanks for the explanation @Screwtapello @krobelus

pickfire

comment created time in 2 days

issue commentrust-windowing/winit

Tracking issue for CompositionEvent support

One benefit is that you'll know precisely when you actually have IME, so you won't call to set_ime_position until you've got an event from a winit that IME was enabled for some window.

Based on my experience with xinput on X11, I believe it is good to be able to call set_ime_position when the IME was enabled rather than updating it for every key press or some weird solution to make some timer to update it once it a while.

murarth

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

issue commentrust-lang/rustfmt

Strange comment formatting

Maybe off-topic, I just wonder if I should create a new issue (or I am lazy).

/// Hello
/// world.

Should be formatted as

/// Hello world.

But if the sentence already ends.

/// Hello.
/// World.

Then it should be the same. Other languages may need to be checked as well.

stjepang

comment created time in 2 days

push eventpickfire/rust.vim

Ivan Tham

commit sha 53682f4810962ad9cc9a1857fa48a086badd95a9

Dedent on curly braces on other blocks like for Based on rust.kak Fix #421

view details

push time in 2 days

push eventpickfire/rust.vim

Ivan Tham

commit sha 43c3dcb127e52637b21a193d160d90dbb12bea75

Dedent on curly braces on other blocks like for Based on rust.kak Fix #421

view details

push time in 2 days

PR opened rust-lang/rust.vim

Dedent on curly braces on other blocks like for

Based on rust.kak Fix #421

+1 -2

0 comment

1 changed file

pr created time in 2 days

create barnchpickfire/rust.vim

branch : dedent-curly

created branch time in 2 days

startedrust-lang/rust.vim

started time in 2 days

fork pickfire/rust.vim

Vim configuration for Rust.

fork in 2 days

push eventpickfire/kakoune

Ivan Tham

commit sha 56e12013c850523a8de983bb4ecc6f66d45a4815

Rust indent keyword check boundary

view details

push time in 2 days

push eventpickfire/kakoune

Ivan Tham

commit sha df68a77ed2612ec1d73c7de767fa698a98302c61

Rust reindent where to match block

view details

push time in 2 days

issue openedrust-lang/rust.vim

Dedent curly braces

<!--

Hi, and thanks for reporting an issue with rust.vim.

Details about your environment will help us assist you.

Please edit this template!

-->

  • rust.vim version: 96e79e3 <!-- Describe if you use a Vim plugin manager, and you can use it to tell which version of rust.vim you are running. -->

Steps to reproduce:

<!-- It's best to try to reproduce the issue with the master version of rust.vim. The issue may already be fixed! -->

for (_z, group) in rendering_batches
    .iter()
    .sorted_by(|a, b| Ord::cmp(&a.0, &b.0))

Press o and {, the curly braces does not dedent. I noticed this issue when improving kakoune vim indentation recently https://github.com/mawww/kakoune/pull/3767

Relevant test at https://github.com/mawww/kakoune/pull/3767/files#diff-a5e6f076e466bf49de7e8d7bb2826d81R43

Expected vs. actual behavior:

for (_z, group) in rendering_batches
    .iter()
    .sorted_by(|a, b| Ord::cmp(&a.0, &b.0))
{
for (_z, group) in rendering_batches
    .iter()
    .sorted_by(|a, b| Ord::cmp(&a.0, &b.0))
    {

Paste debugging info from the Rust Vim plugin via one of the following commands: :RustInfo, :RustInfoToClipboard, or :RustInfoToFile <filename>.

rust.vim Global Variables:

let g:ftplugin_rust_source_path = v:null let g:loaded_syntastic_rust_cargo_checker = v:null let g:loaded_syntastic_rust_filetype = v:null let g:loaded_syntastic_rust_rustc_checker = v:null let g:rust_bang_comment_leader = v:null let g:rust_cargo_avoid_whole_workspace = v:null let g:rust_clip_command = v:null let g:rust_conceal = v:null let g:rust_conceal_mod_path = v:null let g:rust_conceal_pub = v:null let g:rust_fold = v:null let g:rust_last_args = v:null let b:rust_last_args = [] let g:rust_last_rustc_args = v:null let b:rust_last_rustc_args = [] let g:rust_original_delimitMate_excluded_regions = v:null let g:rust_playpen_url = v:null let g:rust_prev_delimitMate_quotes = v:null let g:rust_recent_nearest_cargo_tol = v:null let g:rust_recent_root_cargo_toml = v:null let g:rust_recommended_style = v:null let g:rust_set_conceallevel = v:null let g:rust_set_conceallevel=1 = v:null let g:rust_set_foldmethod = v:null let g:rust_set_foldmethod=1 = v:null let g:rust_shortener_url = v:null let g:rustc_makeprg_no_percent = v:null let g:rustc_path = v:null let g:rustfmt_autosave = 0 let g:rustfmt_autosave_if_config_present = v:null let g:rustfmt_command = 'rustfmt' let g:rustfmt_emit_files = 1 let g:rustfmt_fail_silently = 0 let g:rustfmt_options = '' let g:syntastic_extra_filetypes = ['rust'] let g:syntastic_rust_cargo_fname = v:null rustfmt 1.4.21-nightly (01f2ead 2020-09-04)

rustc 1.48.0-nightly (043f6d747 2020-09-25)

cargo 1.48.0-nightly (8777a6b1e 2020-09-15)

NVIM v0.4.4 Build type: Release LuaJIT 2.0.5 Compilation: /usr/bin/cc -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.4.4/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include Compiled by builduser

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

created time in 2 days

push eventpickfire/kakoune

Ivan Tham

commit sha 785cbaeaed59d4ec78ad2935b5ef2ac340e2ac03

Add rust test for empty line indent

view details

push time in 2 days

issue closedmawww/kakoune

Regex negate not working when \h is used

Steps <!-- how to reproduce the issue? -->

  1. Insert " .a" (there are some spaces, insert without quote)
  2. alt-k ^\h*[^.] <ret>

Outcome <!-- what is the result of the above steps? -->

It was selected.

Expected <!-- what should have been the result of the above steps? -->

It should not be selected.

However, if \h in not used, it works. Workaround, s [^h].* <ret> and then only use ^ instead of ^\h*.

closed time in 2 days

pickfire

issue commentmawww/kakoune

Regex negate not working when \h is used

The first one works fine, because the <a-k> regex does not need to match the enitre selection, only a substring.

Ah, I didn't know about that. I though tit needs to match the entire selection.

Okay, I was actually matching the whole string but I thought echo ' .' | kak -f '<a-k>^\h*[^.]<ret>' should fail since it did not match the [^.] part which I think it should, weird that it does not, I still don't get why.

What I was trying out was:

$ echo ' + 1' | kak -f '<a-k>^\h*[^.+-].*[^\h].*[^,<semicolon>]$<ret>'
 + 1

But I guess I have some issues with the regex. Then I created one with a more complex kak script.

try %< execute-keys -draft k <a-x> s [^\h].+ <ret> <a-K> \A[-+*/&|^})<gt><lt>] <ret> <a-K> [,<semicolon>](\h*/[/*].*|)$ <ret> j <a-gt> >

Nevermind, I guess I can just keep the s rather than using <a-k>.

Thanks for clarifying.

pickfire

comment created time in 2 days

push eventpickfire/rust

Ivan Tham

commit sha 138a412fe661dc166f4b1fb1ddca6f6c0d0d701f

Split alloc vec spec from iter comment into parts

view details

push time in 3 days

issue commentactix/actix-web

Compile time type-safe Data extractor

The cost is not complexity, it's that it will break lots of existing code.

Then could this be part of a major release since it is a breaking change? I mean it is a breaking change since it should not allow broken type in the first place, I know it is hard since it may be hard to not use Any type but rely only on features available in the rust compiler.

Runtime type check is safe.

Yes, it is safe. But since I saw actix-web keep putting post to remove the use of unsafe but why not remove foot guns which affects the users? Even other languages like python is safe, I believe it would be a great deal breaker to use a library that does not have foot gun here and there, I personally prefer rust over python due to less runtime error.

There is no such thing called "if it compiles, it works", at least not for Rust. You need a lot of tests and even with those you would still get thing wrong here and there.

It is almost there, I mean excluding logic errors. At least one does not need to invoke a debugger to check out what is wrong. I never said to skip test but for quick prototyping, it would still be better for the compiler to warn me what is wrong rather than having to cargo run (and here requires another curl to check if the data extractor is working) instead of just cargo check (most online articles mention that this is enough, I also personally found this very sufficient frequently).

At first, I wonder if this is feasible or not, but now I know that you built a prototype means it is working, I thought it may not be possible to do so. So now at least I know that there is a breaking change but not as bad as I thought it would, like harming the ergonomics or performance or having extra complexity.

pickfire

comment created time in 3 days

issue commentmawww/kakoune

Regex negate not working when \h is used

I mean as in [^.] should fail when matching the period since it negate that out, using it directly works but not with ^\h*.

pickfire

comment created time in 3 days

PR opened mawww/kakoune

Rust indent

Before

foo%( )
foo
.bar

After

foo%( )
foo
    .bar

For operation c bar. I put checks on operators like ., and even those - or &&.

+150 -14

0 comment

14 changed files

pr created time in 3 days

create barnchpickfire/kakoune

branch : rust-indent

created branch time in 3 days

issue commentactix/actix-web

Compile time type-safe Data extractor

TLDR: A static typed state would break all middlewares and all type extractors. ResponseBuilder would also require extra type signature. Too much of a price to pay and the gain is little in comparison.

But the price is not a runtime-cost but however the current one not only incur some runtime cost for data type lookup in hashmap but also results in safety cost, if that part of code was not tested it might suddenly just break, it does not have the safety rust provides such that "if it compiles, it works".

pickfire

comment created time in 3 days

issue commentmawww/kakoune

Regex negate not working when \h is used

No, I mean negation as in [^.] in the regex, not <kbd>a-k</kbd>.

pickfire

comment created time in 3 days

issue openedmawww/kakoune

Regex negate not working when \h is used

Steps <!-- how to reproduce the issue? -->

  1. Insert " .a" (there are some spaces, insert without quote)
  2. alt-k ^\h*[^.] <ret>

Outcome <!-- what is the result of the above steps? -->

It was selected.

Expected <!-- what should have been the result of the above steps? -->

It should not be selected.

However, if \h in not used, it works. Workaround, s [^h].* <ret> and then only use ^ instead of ^\h*.

created time in 3 days

Pull request review commentrust-lang/rust

Slightly improve comment for spec from iter doc

 impl<T> Drop for InPlaceDrop<T> {  impl<T> SpecFromIter<T, IntoIter<T>> for Vec<T> {     fn from_iter(iterator: IntoIter<T>) -> Self {-        // A common case is passing a vector into a function which immediately-        // re-collects into a vector. We can short circuit this if the IntoIter-        // has not been advanced at all.-        // When it has been advanced We can also reuse the memory and move the data to the front.-        // But we only do so when the resulting Vec wouldn't have more unused capacity-        // than creating it through the generic FromIterator implementation would. That limitation-        // is not strictly necessary as Vec's allocation behavior is intentionally unspecified.-        // But it is a conservative choice.+        // It is common to pass a vector to a function which immediately+        // re-collects as a vector. We can short circuit this if the IntoIter+        // has not been advanced.+        //+        // If it has been advanced, we can reuse the memory by moving the+        // data to the front. But we only do so when the resulting Vec+        // would have less unused capacity than extending a new Vec with the+        // generic from_iter would. This limitation is not strictly necessary+        // as Vec's allocation is intentionally unspecified.+        // This is a conservative choice.

How about this?

    fn from_iter(iterator: IntoIter<T>) -> Self {
        // It is common to pass a vector to a function which immediately
        // re-collects as a vector. We can short circuit this behavior if
        // the IntoIter has not been advanced.
        //
        // We reuse the original buffer if the iterator has not been advanced
        // or if there is small unused capacity if we reuse the buffer.
        let has_advanced = iterator.buf.as_ptr() as *const _ != iterator.ptr;
        if !has_advanced || iterator.len() >= iterator.cap / 2 {
            unsafe {
                let it = ManuallyDrop::new(iterator);
                // If it has been advanced, we reuse the memory by moving
                // the data to the front.
                if has_advanced {
                    ptr::copy(it.ptr, it.buf.as_ptr(), it.len());
                }
                return Vec::from_raw_parts(it.buf.as_ptr(), it.len(), it.cap);
            }
        }

        // We use a conservative method to grow a new Vec with the generic
        // from_iter if there is a large unused capacity after the
        // optimization above. This limitation is not strictly necessary as
        // Vec's allocation is intentionally unspecified.
        let mut vec = Vec::new();
        // must delegate to spec_extend() since extend() itself delegates to spec_from for empty
        // Vecs
        vec.spec_extend(iterator);
        vec
    }

While writing the documentation, iterator.len() >= iterator.cap / 2 does seem to look weird to me, looks kinda magical and I wonder if that works with both large and small capacity. Is there any reason why we are not comparing it with size hint too?

pickfire

comment created time in 3 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Slightly improve comment for spec from iter doc

 impl<T> Drop for InPlaceDrop<T> {  impl<T> SpecFromIter<T, IntoIter<T>> for Vec<T> {     fn from_iter(iterator: IntoIter<T>) -> Self {-        // A common case is passing a vector into a function which immediately-        // re-collects into a vector. We can short circuit this if the IntoIter-        // has not been advanced at all.-        // When it has been advanced We can also reuse the memory and move the data to the front.-        // But we only do so when the resulting Vec wouldn't have more unused capacity-        // than creating it through the generic FromIterator implementation would. That limitation-        // is not strictly necessary as Vec's allocation behavior is intentionally unspecified.-        // But it is a conservative choice.+        // It is common to pass a vector to a function which immediately+        // re-collects as a vector. We can short circuit this if the IntoIter+        // has not been advanced.+        //+        // If it has been advanced, we can reuse the memory by moving the+        // data to the front. But we only do so when the resulting Vec+        // would have less unused capacity than extending a new Vec with the+        // generic from_iter would. This limitation is not strictly necessary+        // as Vec's allocation is intentionally unspecified.+        // This is a conservative choice.

@the8472 Any suggestion to make it better? I tried my best already.

pickfire

comment created time in 3 days

PullRequestReviewEvent

Pull request review commentrust-lang/rust

Slightly improve comment for spec from iter doc

 impl<T> Drop for InPlaceDrop<T> {  impl<T> SpecFromIter<T, IntoIter<T>> for Vec<T> {     fn from_iter(iterator: IntoIter<T>) -> Self {-        // A common case is passing a vector into a function which immediately-        // re-collects into a vector. We can short circuit this if the IntoIter-        // has not been advanced at all.-        // When it has been advanced We can also reuse the memory and move the data to the front.-        // But we only do so when the resulting Vec wouldn't have more unused capacity-        // than creating it through the generic FromIterator implementation would. That limitation-        // is not strictly necessary as Vec's allocation behavior is intentionally unspecified.-        // But it is a conservative choice.+        // It is common to pass a vector to a function which immediately+        // re-collects as a vector. We can short circuit this if the IntoIter+        // has not been advanced.+        //+        // If it has been advanced, we can reuse the memory by moving the+        // data to the front. But we only do so when the resulting Vec+        // would have less unused capacity than extending a new Vec with the+        // generic from_iter would. This limitation is not strictly necessary+        // as Vec's allocation is intentionally unspecified.+        // This is a conservative choice.
    fn from_iter(iterator: IntoIter<T>) -> Self {
        // It is common to pass a vector to a function which immediately
        // re-collects as a vector. We can short circuit this behavior if
        // the IntoIter has not been advanced.
        let has_advanced = iterator.buf.as_ptr() as *const _ != iterator.ptr;
        if !has_advanced || iterator.len() >= iterator.cap / 2 {
            unsafe {
                let it = ManuallyDrop::new(iterator);
                // If it has been advanced, we reuse the memory by moving
                // the data to the front.
                if has_advanced {
                    ptr::copy(it.ptr, it.buf.as_ptr(), it.len());
                }
                return Vec::from_raw_parts(it.buf.as_ptr(), it.len(), it.cap);
            }
        }

        // A conservative choice to grow a new Vec with the generic from_iter
        // if there is a large unused capacity after the optimization above.
        // This limitation is not strictly necessary as Vec's allocation is
        // intentionally unspecified.
        let mut vec = Vec::new();
        // must delegate to spec_extend() since extend() itself delegates to spec_from for empty
        // Vecs
        vec.spec_extend(iterator);
        vec
    }

What do you think?

pickfire

comment created time in 4 days

more