Hi all, can somebody help me to rewrite this piece of code with new unboxed closures:
struct Builder;
pub fn build(rules: |params: &mut Builder|) -> Builder {
let mut builder = Builder::new();
rules(&mut builder);
builder
}
{ | |
"auto_complete_commit_on_tab": true, | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Color Scheme - Default/Dawn.tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
".DS_Store", | |
".tags*", | |
"*.pyc", |
package main | |
import ( | |
"bufio" | |
"fmt" | |
"net" | |
) | |
func handleConnection(conn net.Conn) { | |
fmt.Println(conn) |
// ---- | |
// Sass (v3.3.14) | |
// Compass (v1.0.0.rc.1) | |
// ---- | |
@media mobile { | |
@media(min-aspect-ratio: 8/5){ | |
.b-bg_logo{ | |
width: 18vh; | |
height: 6vh; |
interface Result<T, E> { | |
map<U>(fn: (a: T) => U): Result<U, E>; | |
mapErr<U>(fn: (a: E) => U): Result<T, U>; | |
isOk(): boolean; | |
isErr(): boolean; | |
ok(): Option<T>; | |
err(): Option<E>; | |
and<U>(res: Result<U,E>): Result<U,E>; | |
andThen<U>(op: (T) => Result<U,E>): Result<U,E>; |
module classes { | |
export interface ClassManager { | |
mod(...name: string[]): ClassManager; | |
cmod(condition: boolean, ...name: string[]): ClassManager; | |
toString(): string; | |
before(...other: ToString[]): ClassManager; | |
after(...other: ToString[]): ClassManager; | |
} |
interface Option<T> { | |
map <U>(fn: (a: T) => U): Option<U>; | |
isSome(): boolean; | |
isNone(): boolean; | |
isSomeAnd(fn: (a: T) => boolean): boolean; | |
isNoneAnd(fn: () => boolean): boolean; | |
unwrap(): T; | |
unwrapOr(def: T): T; | |
unwrapOrElse(f: () => T): T; | |
map<U>(f: (a: T) => U): Option<U>; |
Hi all, can somebody help me to rewrite this piece of code with new unboxed closures:
struct Builder;
pub fn build(rules: |params: &mut Builder|) -> Builder {
let mut builder = Builder::new();
rules(&mut builder);
builder
}
var convertSM = require('convert-source-map'); | |
var fs = require('fs'); | |
var rewrite = require('connect-modrewrite'); | |
module.exports = function (grunt) { | |
grunt.registerTask('tsmap', function() { | |
var existingMap; | |
var fileName = process.cwd() + '/dist/app.js'; | |
var fileContent = fs.readFileSync(fileName).toString(); |
var viewClass = bemr.block("card"); | |
return DOM.div({className: viewClass}, | |
DOM.div({className: viewClass.el("cover")}, | |
avatar.AvatarF({ | |
url: "/public/profile.png", | |
variant: avatar.Variant.Large, | |
className: viewClass.el("avatar") | |
}), | |
DOM.div({className: viewClass.el("name")}, user.name) |
private dispatchLoadOrgs(action: org_actions.LoadOrgs.Start) { | |
loadOrgsLock.lock(action.actionId, api.requestManager); | |
org_api.OrgApi | |
.loadOrgs(action.actionId) | |
.then((reply) => { | |
loadOrgsLock.unlock(); | |
this.dispatcher.dispatch(new org_actions.LoadOrgs.Complete(action, reply.orgs)) | |
}) | |
.catch((e) => { |